From ab25bb6fc727d390923d8d225361845125631cf6 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 27 Apr 2023 21:03:27 +0000 Subject: [PATCH 1/3] feat: add NVIDIA_L4 to AcceleratorType feat: add experiment and experiment_run to CustomJobSpec feat: add MutateDeployedModel RPC to endpoint_service feat: add offline_storage_ttl_days to EntityType feat: add online_storage_ttl_days to FeatureStore feat: add GENIE to ModelSourceType PiperOrigin-RevId: 527640029 Source-Link: https://github.com/googleapis/googleapis/commit/f1979d44cde653c9d2169863f7c84aaa1801fe25 Source-Link: https://github.com/googleapis/googleapis-gen/commit/17f5433351a3cda5e3c824fcdb10d55b05a13d2e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6IjE3ZjU0MzMzNTFhM2NkYTVlM2M4MjRmY2RiMTBkNTViMDVhMTNkMmUifQ== --- .../google-cloud-aiplatform/v1/.eslintignore | 7 + .../google-cloud-aiplatform/v1/.eslintrc.json | 3 + .../google-cloud-aiplatform/v1/.gitignore | 14 + .../google-cloud-aiplatform/v1/.jsdoc.js | 55 + .../google-cloud-aiplatform/v1/.mocharc.js | 33 + .../google-cloud-aiplatform/v1/.prettierrc.js | 22 + .../google-cloud-aiplatform/v1/README.md | 1 + .../v1/linkinator.config.json | 16 + .../google-cloud-aiplatform/v1/package.json | 78 + .../aiplatform/v1/accelerator_type.proto | 61 + .../cloud/aiplatform/v1/annotation.proto | 96 + .../cloud/aiplatform/v1/annotation_spec.proto | 57 + .../google/cloud/aiplatform/v1/artifact.proto | 112 + .../aiplatform/v1/batch_prediction_job.proto | 455 + .../aiplatform/v1/completion_stats.proto | 50 + .../google/cloud/aiplatform/v1/context.proto | 97 + .../cloud/aiplatform/v1/custom_job.proto | 321 + .../cloud/aiplatform/v1/data_item.proto | 73 + .../aiplatform/v1/data_labeling_job.proto | 210 + .../google/cloud/aiplatform/v1/dataset.proto | 201 + .../cloud/aiplatform/v1/dataset_service.proto | 631 + .../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 | 289 + .../aiplatform/v1/endpoint_service.proto | 425 + .../cloud/aiplatform/v1/entity_type.proto | 98 + .../google/cloud/aiplatform/v1/env_var.proto | 42 + .../aiplatform/v1/evaluated_annotation.proto | 181 + .../google/cloud/aiplatform/v1/event.proto | 81 + .../cloud/aiplatform/v1/execution.proto | 118 + .../cloud/aiplatform/v1/explanation.proto | 501 + .../aiplatform/v1/explanation_metadata.proto | 423 + .../google/cloud/aiplatform/v1/feature.proto | 162 + .../v1/feature_monitoring_stats.proto | 87 + .../aiplatform/v1/feature_selector.proto | 44 + .../cloud/aiplatform/v1/featurestore.proto | 152 + .../v1/featurestore_monitoring.proto | 151 + .../v1/featurestore_online_service.proto | 285 + .../aiplatform/v1/featurestore_service.proto | 1444 +++ .../v1/hyperparameter_tuning_job.proto | 116 + .../google/cloud/aiplatform/v1/index.proto | 177 + .../cloud/aiplatform/v1/index_endpoint.proto | 285 + .../v1/index_endpoint_service.proto | 362 + .../cloud/aiplatform/v1/index_service.proto | 356 + .../google/cloud/aiplatform/v1/io.proto | 109 + .../cloud/aiplatform/v1/job_service.proto | 1372 +++ .../cloud/aiplatform/v1/job_state.proto | 63 + .../aiplatform/v1/lineage_subgraph.proto | 42 + .../aiplatform/v1/machine_resources.proto | 216 + .../v1/manual_batch_tuning_parameters.proto | 39 + .../cloud/aiplatform/v1/metadata_schema.proto | 80 + .../aiplatform/v1/metadata_service.proto | 1389 +++ .../cloud/aiplatform/v1/metadata_store.proto | 67 + .../aiplatform/v1/migratable_resource.proto | 155 + .../aiplatform/v1/migration_service.proto | 320 + .../google/cloud/aiplatform/v1/model.proto | 715 ++ .../v1/model_deployment_monitoring_job.proto | 326 + .../aiplatform/v1/model_evaluation.proto | 119 + .../v1/model_evaluation_slice.proto | 193 + .../aiplatform/v1/model_monitoring.proto | 219 + .../cloud/aiplatform/v1/model_service.proto | 870 ++ .../google/cloud/aiplatform/v1/nas_job.proto | 306 + .../cloud/aiplatform/v1/operation.proto | 55 + .../v1/pipeline_failure_policy.proto | 44 + .../cloud/aiplatform/v1/pipeline_job.proto | 408 + .../aiplatform/v1/pipeline_service.proto | 450 + .../cloud/aiplatform/v1/pipeline_state.proto | 58 + .../aiplatform/v1/prediction_service.proto | 261 + .../cloud/aiplatform/v1/saved_query.proto | 87 + .../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 + .../aiplatform/v1/service_networking.proto | 38 + .../cloud/aiplatform/v1/specialist_pool.proto | 64 + .../v1/specialist_pool_service.proto | 225 + .../google/cloud/aiplatform/v1/study.proto | 602 + .../cloud/aiplatform/v1/tensorboard.proto | 96 + .../aiplatform/v1/tensorboard_data.proto | 104 + .../v1/tensorboard_experiment.proto | 83 + .../cloud/aiplatform/v1/tensorboard_run.proto | 83 + .../aiplatform/v1/tensorboard_service.proto | 1133 ++ .../v1/tensorboard_time_series.proto | 112 + .../aiplatform/v1/training_pipeline.proto | 449 + .../google/cloud/aiplatform/v1/types.proto | 49 + .../v1/unmanaged_container_model.proto | 44 + .../aiplatform/v1/user_action_reference.proto | 47 + .../google/cloud/aiplatform/v1/value.proto | 39 + .../cloud/aiplatform/v1/vizier_service.proto | 529 + .../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.search_data_items.js | 145 + .../v1/dataset_service.update_dataset.js | 71 + .../v1/endpoint_service.create_endpoint.js | 83 + .../v1/endpoint_service.delete_endpoint.js | 64 + .../v1/endpoint_service.deploy_model.js | 87 + .../v1/endpoint_service.get_endpoint.js | 63 + .../v1/endpoint_service.list_endpoints.js | 108 + .../endpoint_service.mutate_deployed_model.js | 85 + .../v1/endpoint_service.undeploy_model.js | 79 + .../v1/endpoint_service.update_endpoint.js | 67 + ...ine_serving_service.read_feature_values.js | 77 + ...g_service.streaming_read_feature_values.js | 81 + ...ne_serving_service.write_feature_values.js | 72 + ...turestore_service.batch_create_features.js | 73 + ...store_service.batch_read_feature_values.js | 114 + ...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 + ...turestore_service.delete_feature_values.js | 73 + ...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 | 124 + ...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 | 100 + ..._endpoint_service.mutate_deployed_index.js | 71 + .../index_endpoint_service.undeploy_index.js | 70 + ..._endpoint_service.update_index_endpoint.js | 67 + .../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 | 85 + .../v1/index_service.remove_datapoints.js | 67 + .../v1/index_service.update_index.js | 68 + .../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 + .../v1/job_service.cancel_nas_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 | 68 + ....create_model_deployment_monitoring_job.js | 67 + .../v1/job_service.create_nas_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 + .../v1/job_service.delete_nas_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 + .../generated/v1/job_service.get_nas_job.js | 63 + .../v1/job_service.get_nas_trial_detail.js | 63 + .../job_service.list_batch_prediction_jobs.js | 101 + .../v1/job_service.list_custom_jobs.js | 100 + .../v1/job_service.list_data_labeling_jobs.js | 104 + ...service.list_hyperparameter_tuning_jobs.js | 101 + ...e.list_model_deployment_monitoring_jobs.js | 95 + .../generated/v1/job_service.list_nas_jobs.js | 100 + .../v1/job_service.list_nas_trial_details.js | 78 + ...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 | 91 + ...ce.add_context_artifacts_and_executions.js | 76 + .../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 | 78 + .../v1/metadata_service.create_execution.js | 80 + ...metadata_service.create_metadata_schema.js | 79 + .../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 | 116 + .../v1/metadata_service.list_contexts.js | 119 + .../v1/metadata_service.list_executions.js | 116 + .../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 | 63 + ...etadata_service.remove_context_children.js | 67 + .../v1/metadata_service.update_artifact.js | 75 + .../v1/metadata_service.update_context.js | 74 + .../v1/metadata_service.update_execution.js | 75 + ...gration_service.batch_migrate_resources.js | 70 + ...ion_service.search_migratable_resources.js | 89 + ...vice.batch_import_evaluated_annotations.js | 68 + ...ce.batch_import_model_evaluation_slices.js | 68 + .../generated/v1/model_service.copy_model.js | 88 + .../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 | 87 + .../model_service.list_model_evaluations.js | 85 + .../v1/model_service.list_model_versions.js | 100 + .../generated/v1/model_service.list_models.js | 108 + .../v1/model_service.merge_version_aliases.js | 78 + .../v1/model_service.update_model.js | 85 + .../v1/model_service.upload_model.js | 90 + .../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 | 128 + ...ipeline_service.list_training_pipelines.js | 100 + .../v1/prediction_service.explain.js | 101 + .../v1/prediction_service.predict.js | 84 + .../v1/prediction_service.raw_predict.js | 79 + ...t_metadata.google.cloud.aiplatform.v1.json | 9643 +++++++++++++++ ...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 | 81 + ...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 | 73 + .../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 + ...sorboard_service.read_tensorboard_usage.js | 63 + .../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 + .../google-cloud-aiplatform/v1/src/index.ts | 53 + .../v1/src/v1/dataset_service_client.ts | 4823 ++++++++ .../src/v1/dataset_service_client_config.json | 74 + .../v1/src/v1/dataset_service_proto_list.json | 115 + .../v1/src/v1/endpoint_service_client.ts | 3975 ++++++ .../v1/endpoint_service_client_config.json | 58 + .../src/v1/endpoint_service_proto_list.json | 115 + ...turestore_online_serving_service_client.ts | 2957 +++++ ..._online_serving_service_client_config.json | 38 + ...ore_online_serving_service_proto_list.json | 115 + .../v1/src/v1/featurestore_service_client.ts | 6109 +++++++++ .../featurestore_service_client_config.json | 110 + .../v1/featurestore_service_proto_list.json | 115 + .../v1/src/v1/gapic_metadata.json | 2439 ++++ .../v1/src/v1/index.ts | 33 + .../src/v1/index_endpoint_service_client.ts | 3901 ++++++ .../index_endpoint_service_client_config.json | 58 + .../v1/index_endpoint_service_proto_list.json | 115 + .../v1/src/v1/index_service_client.ts | 3717 ++++++ .../src/v1/index_service_client_config.json | 54 + .../v1/src/v1/index_service_proto_list.json | 115 + .../v1/src/v1/job_service_client.ts | 7238 +++++++++++ .../v1/src/v1/job_service_client_config.json | 166 + .../v1/src/v1/job_service_proto_list.json | 115 + .../v1/src/v1/metadata_service_client.ts | 6749 ++++++++++ .../v1/metadata_service_client_config.json | 154 + .../src/v1/metadata_service_proto_list.json | 115 + .../v1/src/v1/migration_service_client.ts | 3314 +++++ .../v1/migration_service_client_config.json | 34 + .../src/v1/migration_service_proto_list.json | 115 + .../v1/src/v1/model_service_client.ts | 5134 ++++++++ .../src/v1/model_service_client_config.json | 94 + .../v1/src/v1/model_service_proto_list.json | 115 + .../v1/src/v1/pipeline_service_client.ts | 4265 +++++++ .../v1/pipeline_service_client_config.json | 66 + .../src/v1/pipeline_service_proto_list.json | 115 + .../v1/src/v1/prediction_service_client.ts | 3030 +++++ .../v1/prediction_service_client_config.json | 38 + .../src/v1/prediction_service_proto_list.json | 115 + .../src/v1/specialist_pool_service_client.ts | 3564 ++++++ ...specialist_pool_service_client_config.json | 46 + .../specialist_pool_service_proto_list.json | 115 + .../v1/src/v1/tensorboard_service_client.ts | 6135 ++++++++++ .../v1/tensorboard_service_client_config.json | 142 + .../v1/tensorboard_service_proto_list.json | 115 + .../v1/src/v1/vizier_service_client.ts | 4388 +++++++ .../src/v1/vizier_service_client_config.json | 86 + .../v1/src/v1/vizier_service_proto_list.json | 115 + .../system-test/fixtures/sample/src/index.js | 41 + .../system-test/fixtures/sample/src/index.ts | 116 + .../v1/system-test/install.ts | 49 + .../v1/test/gapic_dataset_service_v1.ts | 4968 ++++++++ .../v1/test/gapic_endpoint_service_v1.ts | 4034 ++++++ ..._featurestore_online_serving_service_v1.ts | 2790 +++++ .../v1/test/gapic_featurestore_service_v1.ts | 6209 ++++++++++ .../test/gapic_index_endpoint_service_v1.ts | 4034 ++++++ .../v1/test/gapic_index_service_v1.ts | 3834 ++++++ .../v1/test/gapic_job_service_v1.ts | 8001 ++++++++++++ .../v1/test/gapic_metadata_service_v1.ts | 7350 +++++++++++ .../v1/test/gapic_migration_service_v1.ts | 3198 +++++ .../v1/test/gapic_model_service_v1.ts | 5417 ++++++++ .../v1/test/gapic_pipeline_service_v1.ts | 4245 +++++++ .../v1/test/gapic_prediction_service_v1.ts | 2787 +++++ .../test/gapic_specialist_pool_service_v1.ts | 3618 ++++++ .../v1/test/gapic_tensorboard_service_v1.ts | 6939 +++++++++++ .../v1/test/gapic_vizier_service_v1.ts | 4785 ++++++++ .../google-cloud-aiplatform/v1/tsconfig.json | 19 + .../v1/webpack.config.js | 64 + .../v1beta1/.eslintignore | 7 + .../v1beta1/.eslintrc.json | 3 + .../v1beta1/.gitignore | 14 + .../google-cloud-aiplatform/v1beta1/.jsdoc.js | 55 + .../v1beta1/.mocharc.js | 33 + .../v1beta1/.prettierrc.js | 22 + .../google-cloud-aiplatform/v1beta1/README.md | 1 + .../v1beta1/linkinator.config.json | 16 + .../v1beta1/package.json | 81 + .../aiplatform/v1beta1/accelerator_type.proto | 61 + .../cloud/aiplatform/v1beta1/annotation.proto | 96 + .../aiplatform/v1beta1/annotation_spec.proto | 57 + .../cloud/aiplatform/v1beta1/artifact.proto | 112 + .../v1beta1/batch_prediction_job.proto | 472 + .../aiplatform/v1beta1/completion_stats.proto | 50 + .../cloud/aiplatform/v1beta1/context.proto | 97 + .../cloud/aiplatform/v1beta1/custom_job.proto | 301 + .../cloud/aiplatform/v1beta1/data_item.proto | 74 + .../v1beta1/data_labeling_job.proto | 210 + .../cloud/aiplatform/v1beta1/dataset.proto | 202 + .../aiplatform/v1beta1/dataset_service.proto | 631 + .../v1beta1/deployed_index_ref.proto | 42 + .../v1beta1/deployed_model_ref.proto | 42 + .../v1beta1/deployment_resource_pool.proto | 53 + .../deployment_resource_pool_service.proto | 236 + .../aiplatform/v1beta1/encryption_spec.proto | 38 + .../cloud/aiplatform/v1beta1/endpoint.proto | 298 + .../aiplatform/v1beta1/endpoint_service.proto | 350 + .../aiplatform/v1beta1/entity_type.proto | 98 + .../cloud/aiplatform/v1beta1/env_var.proto | 42 + .../v1beta1/evaluated_annotation.proto | 185 + .../cloud/aiplatform/v1beta1/event.proto | 81 + .../cloud/aiplatform/v1beta1/execution.proto | 118 + .../aiplatform/v1beta1/explanation.proto | 564 + .../v1beta1/explanation_metadata.proto | 424 + .../cloud/aiplatform/v1beta1/feature.proto | 185 + .../v1beta1/feature_monitoring_stats.proto | 87 + .../aiplatform/v1beta1/feature_selector.proto | 44 + .../aiplatform/v1beta1/featurestore.proto | 152 + .../v1beta1/featurestore_monitoring.proto | 163 + .../v1beta1/featurestore_online_service.proto | 285 + .../v1beta1/featurestore_service.proto | 1444 +++ .../v1beta1/hyperparameter_tuning_job.proto | 116 + .../cloud/aiplatform/v1beta1/index.proto | 177 + .../aiplatform/v1beta1/index_endpoint.proto | 286 + .../v1beta1/index_endpoint_service.proto | 362 + .../aiplatform/v1beta1/index_service.proto | 356 + .../google/cloud/aiplatform/v1beta1/io.proto | 109 + .../aiplatform/v1beta1/job_service.proto | 1372 +++ .../cloud/aiplatform/v1beta1/job_state.proto | 63 + .../aiplatform/v1beta1/lineage_subgraph.proto | 42 + .../v1beta1/machine_resources.proto | 216 + .../manual_batch_tuning_parameters.proto | 39 + .../aiplatform/v1beta1/match_service.proto | 176 + .../aiplatform/v1beta1/metadata_schema.proto | 80 + .../aiplatform/v1beta1/metadata_service.proto | 1392 +++ .../aiplatform/v1beta1/metadata_store.proto | 67 + .../v1beta1/migratable_resource.proto | 155 + .../v1beta1/migration_service.proto | 321 + .../cloud/aiplatform/v1beta1/model.proto | 724 ++ .../model_deployment_monitoring_job.proto | 326 + .../aiplatform/v1beta1/model_evaluation.proto | 96 + .../v1beta1/model_evaluation_slice.proto | 194 + .../aiplatform/v1beta1/model_monitoring.proto | 250 + .../aiplatform/v1beta1/model_service.proto | 900 ++ .../cloud/aiplatform/v1beta1/nas_job.proto | 306 + .../cloud/aiplatform/v1beta1/operation.proto | 55 + .../v1beta1/pipeline_failure_policy.proto | 44 + .../aiplatform/v1beta1/pipeline_job.proto | 409 + .../aiplatform/v1beta1/pipeline_service.proto | 450 + .../aiplatform/v1beta1/pipeline_state.proto | 58 + .../v1beta1/prediction_service.proto | 256 + .../aiplatform/v1beta1/saved_query.proto | 87 + .../cloud/aiplatform/v1beta1/schedule.proto | 151 + .../aiplatform/v1beta1/schedule_service.proto | 275 + .../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 + .../v1beta1/service_networking.proto | 38 + .../aiplatform/v1beta1/specialist_pool.proto | 64 + .../v1beta1/specialist_pool_service.proto | 225 + .../cloud/aiplatform/v1beta1/study.proto | 663 + .../aiplatform/v1beta1/tensorboard.proto | 96 + .../aiplatform/v1beta1/tensorboard_data.proto | 104 + .../v1beta1/tensorboard_experiment.proto | 81 + .../aiplatform/v1beta1/tensorboard_run.proto | 83 + .../v1beta1/tensorboard_service.proto | 1131 ++ .../v1beta1/tensorboard_time_series.proto | 112 + .../v1beta1/training_pipeline.proto | 450 + .../cloud/aiplatform/v1beta1/types.proto | 49 + .../v1beta1/unmanaged_container_model.proto | 44 + .../v1beta1/user_action_reference.proto | 47 + .../cloud/aiplatform/v1beta1/value.proto | 39 + .../aiplatform/v1beta1/vizier_service.proto | 529 + .../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 + .../dataset_service.search_data_items.js | 145 + .../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 | 83 + .../endpoint_service.delete_endpoint.js | 64 + .../v1beta1/endpoint_service.deploy_model.js | 87 + .../v1beta1/endpoint_service.get_endpoint.js | 63 + .../endpoint_service.list_endpoints.js | 98 + .../endpoint_service.undeploy_model.js | 79 + .../endpoint_service.update_endpoint.js | 67 + ...ine_serving_service.read_feature_values.js | 77 + ...g_service.streaming_read_feature_values.js | 81 + ...ne_serving_service.write_feature_values.js | 72 + ...turestore_service.batch_create_features.js | 73 + ...store_service.batch_read_feature_values.js | 114 + ...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 + ...turestore_service.delete_feature_values.js | 73 + ...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 | 124 + ...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 | 100 + ..._endpoint_service.mutate_deployed_index.js | 71 + .../index_endpoint_service.undeploy_index.js | 70 + ..._endpoint_service.update_index_endpoint.js | 67 + .../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 | 85 + .../index_service.remove_datapoints.js | 67 + .../v1beta1/index_service.update_index.js | 68 + .../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 + .../v1beta1/job_service.cancel_nas_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 | 68 + ....create_model_deployment_monitoring_job.js | 67 + .../v1beta1/job_service.create_nas_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 + .../v1beta1/job_service.delete_nas_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 + .../v1beta1/job_service.get_nas_job.js | 63 + .../job_service.get_nas_trial_detail.js | 63 + .../job_service.list_batch_prediction_jobs.js | 101 + .../v1beta1/job_service.list_custom_jobs.js | 100 + .../job_service.list_data_labeling_jobs.js | 104 + ...service.list_hyperparameter_tuning_jobs.js | 101 + ...e.list_model_deployment_monitoring_jobs.js | 95 + .../v1beta1/job_service.list_nas_jobs.js | 100 + .../job_service.list_nas_trial_details.js | 78 + ...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 | 91 + .../v1beta1/match_service.find_neighbors.js | 83 + .../match_service.read_index_datapoints.js | 71 + ...ce.add_context_artifacts_and_executions.js | 76 + .../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 | 78 + .../metadata_service.create_execution.js | 80 + ...metadata_service.create_metadata_schema.js | 79 + .../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 | 116 + .../v1beta1/metadata_service.list_contexts.js | 119 + .../metadata_service.list_executions.js | 116 + .../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 | 63 + ...etadata_service.remove_context_children.js | 67 + .../metadata_service.update_artifact.js | 76 + .../metadata_service.update_context.js | 75 + .../metadata_service.update_execution.js | 76 + ...gration_service.batch_migrate_resources.js | 70 + ...ion_service.search_migratable_resources.js | 90 + ...vice.batch_import_evaluated_annotations.js | 68 + ...ce.batch_import_model_evaluation_slices.js | 68 + .../v1beta1/model_service.copy_model.js | 88 + .../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 | 87 + .../model_service.list_model_evaluations.js | 85 + .../model_service.list_model_versions.js | 98 + .../v1beta1/model_service.list_models.js | 98 + .../model_service.merge_version_aliases.js | 78 + ...odel_service.update_explanation_dataset.js | 67 + .../v1beta1/model_service.update_model.js | 85 + .../v1beta1/model_service.upload_model.js | 90 + .../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 | 128 + ...ipeline_service.list_training_pipelines.js | 100 + .../v1beta1/prediction_service.explain.js | 102 + .../v1beta1/prediction_service.predict.js | 85 + .../v1beta1/prediction_service.raw_predict.js | 79 + .../schedule_service.create_schedule.js | 67 + .../schedule_service.delete_schedule.js | 64 + .../v1beta1/schedule_service.get_schedule.js | 63 + .../schedule_service.list_schedules.js | 122 + .../schedule_service.pause_schedule.js | 63 + .../schedule_service.resume_schedule.js | 71 + ...adata.google.cloud.aiplatform.v1beta1.json | 10219 ++++++++++++++++ ...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 | 81 + ...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 | 73 + .../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 + ...sorboard_service.read_tensorboard_usage.js | 63 + .../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 + .../v1beta1/src/index.ts | 59 + .../src/v1beta1/dataset_service_client.ts | 4862 ++++++++ .../dataset_service_client_config.json | 84 + .../v1beta1/dataset_service_proto_list.json | 127 + ...deployment_resource_pool_service_client.ts | 3723 ++++++ ...t_resource_pool_service_client_config.json | 46 + ...ment_resource_pool_service_proto_list.json | 127 + .../src/v1beta1/endpoint_service_client.ts | 3867 ++++++ .../endpoint_service_client_config.json | 61 + .../v1beta1/endpoint_service_proto_list.json | 127 + ...turestore_online_serving_service_client.ts | 2996 +++++ ..._online_serving_service_client_config.json | 40 + ...ore_online_serving_service_proto_list.json | 127 + .../v1beta1/featurestore_service_client.ts | 6148 ++++++++++ .../featurestore_service_client_config.json | 129 + .../featurestore_service_proto_list.json | 127 + .../v1beta1/src/v1beta1/gapic_metadata.json | 2623 ++++ .../v1beta1/src/v1beta1/index.ts | 36 + .../v1beta1/index_endpoint_service_client.ts | 3940 ++++++ .../index_endpoint_service_client_config.json | 65 + .../index_endpoint_service_proto_list.json | 127 + .../src/v1beta1/index_service_client.ts | 3756 ++++++ .../v1beta1/index_service_client_config.json | 59 + .../src/v1beta1/index_service_proto_list.json | 127 + .../v1beta1/src/v1beta1/job_service_client.ts | 7277 +++++++++++ .../v1beta1/job_service_client_config.json | 194 + .../src/v1beta1/job_service_proto_list.json | 127 + .../src/v1beta1/match_service_client.ts | 2934 +++++ .../v1beta1/match_service_client_config.json | 34 + .../src/v1beta1/match_service_proto_list.json | 127 + .../src/v1beta1/metadata_service_client.ts | 6791 ++++++++++ .../metadata_service_client_config.json | 179 + .../v1beta1/metadata_service_proto_list.json | 127 + .../src/v1beta1/migration_service_client.ts | 3356 +++++ .../migration_service_client_config.json | 34 + .../v1beta1/migration_service_proto_list.json | 127 + .../src/v1beta1/model_service_client.ts | 5239 ++++++++ .../v1beta1/model_service_client_config.json | 109 + .../src/v1beta1/model_service_proto_list.json | 127 + .../src/v1beta1/pipeline_service_client.ts | 4304 +++++++ .../pipeline_service_client_config.json | 71 + .../v1beta1/pipeline_service_proto_list.json | 127 + .../src/v1beta1/prediction_service_client.ts | 3071 +++++ .../prediction_service_client_config.json | 40 + .../prediction_service_proto_list.json | 127 + .../src/v1beta1/schedule_service_client.ts | 3770 ++++++ .../schedule_service_client_config.json | 50 + .../v1beta1/schedule_service_proto_list.json | 127 + .../v1beta1/specialist_pool_service_client.ts | 3603 ++++++ ...specialist_pool_service_client_config.json | 51 + .../specialist_pool_service_proto_list.json | 127 + .../src/v1beta1/tensorboard_service_client.ts | 6173 ++++++++++ .../tensorboard_service_client_config.json | 142 + .../tensorboard_service_proto_list.json | 127 + .../src/v1beta1/vizier_service_client.ts | 4427 +++++++ .../v1beta1/vizier_service_client_config.json | 101 + .../v1beta1/vizier_service_proto_list.json | 127 + .../system-test/fixtures/sample/src/index.js | 44 + .../system-test/fixtures/sample/src/index.ts | 134 + .../v1beta1/system-test/install.ts | 49 + .../test/gapic_dataset_service_v1beta1.ts | 5006 ++++++++ ...eployment_resource_pool_service_v1beta1.ts | 3773 ++++++ .../test/gapic_endpoint_service_v1beta1.ts | 3918 ++++++ ...urestore_online_serving_service_v1beta1.ts | 2828 +++++ .../gapic_featurestore_service_v1beta1.ts | 6247 ++++++++++ .../gapic_index_endpoint_service_v1beta1.ts | 4072 ++++++ .../test/gapic_index_service_v1beta1.ts | 3872 ++++++ .../v1beta1/test/gapic_job_service_v1beta1.ts | 8039 ++++++++++++ .../test/gapic_match_service_v1beta1.ts | 2717 ++++ .../test/gapic_metadata_service_v1beta1.ts | 7388 +++++++++++ .../test/gapic_migration_service_v1beta1.ts | 3236 +++++ .../test/gapic_model_service_v1beta1.ts | 5609 +++++++++ .../test/gapic_pipeline_service_v1beta1.ts | 4283 +++++++ .../test/gapic_prediction_service_v1beta1.ts | 2825 +++++ .../test/gapic_schedule_service_v1beta1.ts | 3668 ++++++ .../gapic_specialist_pool_service_v1beta1.ts | 3656 ++++++ .../test/gapic_tensorboard_service_v1beta1.ts | 6977 +++++++++++ .../test/gapic_vizier_service_v1beta1.ts | 4823 ++++++++ .../v1beta1/tsconfig.json | 19 + .../v1beta1/webpack.config.js | 64 + 833 files changed, 415780 insertions(+) create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/.eslintignore create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/README.md create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/linkinator.config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/package.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/accelerator_type.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/annotation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/annotation_spec.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/artifact.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/context.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/custom_job.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/data_item.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/data_labeling_job.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/dataset.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/deployed_index_ref.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/deployed_model_ref.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/encryption_spec.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/endpoint.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/endpoint_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/entity_type.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/env_var.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/evaluated_annotation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/event.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/execution.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/explanation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/explanation_metadata.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature_selector.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_endpoint.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_endpoint_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/io.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/job_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/job_state.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/lineage_subgraph.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/machine_resources.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_schema.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_store.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/migratable_resource.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/migration_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_evaluation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/nas_job.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/operation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_state.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/prediction_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/saved_query.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/service_networking.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/specialist_pool.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/specialist_pool_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/study.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_data.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_run.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/types.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/user_action_reference.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/value.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/vizier_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.create_dataset.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.delete_dataset.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.export_data.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.get_annotation_spec.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.get_dataset.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.import_data.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.list_annotations.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.list_data_items.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.list_datasets.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.list_saved_queries.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.search_data_items.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.update_dataset.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.create_endpoint.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.delete_endpoint.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.deploy_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.get_endpoint.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.list_endpoints.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.mutate_deployed_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.undeploy_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.update_endpoint.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_online_serving_service.read_feature_values.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_online_serving_service.streaming_read_feature_values.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_online_serving_service.write_feature_values.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.batch_create_features.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.batch_read_feature_values.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.create_entity_type.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.create_feature.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.create_featurestore.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.delete_entity_type.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.delete_feature.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.delete_feature_values.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.delete_featurestore.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.export_feature_values.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.get_entity_type.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.get_feature.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.get_featurestore.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.import_feature_values.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.list_entity_types.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.list_features.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.list_featurestores.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.search_features.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.update_entity_type.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.update_feature.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.update_featurestore.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_endpoint_service.create_index_endpoint.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_endpoint_service.delete_index_endpoint.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_endpoint_service.deploy_index.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_endpoint_service.get_index_endpoint.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_endpoint_service.list_index_endpoints.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_endpoint_service.mutate_deployed_index.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_endpoint_service.undeploy_index.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_endpoint_service.update_index_endpoint.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_service.create_index.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_service.delete_index.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_service.get_index.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_service.list_indexes.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_service.remove_datapoints.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_service.update_index.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_service.upsert_datapoints.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.cancel_batch_prediction_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.cancel_custom_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.cancel_data_labeling_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.cancel_hyperparameter_tuning_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.cancel_nas_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.create_batch_prediction_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.create_custom_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.create_data_labeling_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.create_hyperparameter_tuning_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.create_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.create_nas_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.delete_batch_prediction_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.delete_custom_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.delete_data_labeling_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.delete_hyperparameter_tuning_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.delete_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.delete_nas_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.get_batch_prediction_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.get_custom_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.get_data_labeling_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.get_hyperparameter_tuning_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.get_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.get_nas_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.get_nas_trial_detail.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.list_batch_prediction_jobs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.list_custom_jobs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.list_data_labeling_jobs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.list_hyperparameter_tuning_jobs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.list_model_deployment_monitoring_jobs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.list_nas_jobs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.list_nas_trial_details.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.pause_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.resume_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.search_model_deployment_monitoring_stats_anomalies.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.update_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.add_context_artifacts_and_executions.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.add_context_children.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.add_execution_events.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.create_artifact.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.create_context.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.create_execution.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.create_metadata_schema.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.create_metadata_store.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.delete_artifact.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.delete_context.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.delete_execution.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.delete_metadata_store.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.get_artifact.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.get_context.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.get_execution.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.get_metadata_schema.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.get_metadata_store.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.list_artifacts.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.list_contexts.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.list_executions.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.list_metadata_schemas.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.list_metadata_stores.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.purge_artifacts.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.purge_contexts.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.purge_executions.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.query_artifact_lineage_subgraph.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.query_context_lineage_subgraph.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.query_execution_inputs_and_outputs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.remove_context_children.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.update_artifact.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.update_context.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.update_execution.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/migration_service.batch_migrate_resources.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/migration_service.search_migratable_resources.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.batch_import_evaluated_annotations.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.batch_import_model_evaluation_slices.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.copy_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.delete_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.delete_model_version.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.export_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.get_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.get_model_evaluation.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.get_model_evaluation_slice.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.import_model_evaluation.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.list_model_evaluation_slices.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.list_model_evaluations.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.list_model_versions.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.list_models.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.merge_version_aliases.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.update_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.upload_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.cancel_pipeline_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.cancel_training_pipeline.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.create_pipeline_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.create_training_pipeline.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.delete_pipeline_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.delete_training_pipeline.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.get_pipeline_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.get_training_pipeline.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.list_pipeline_jobs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.list_training_pipelines.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/prediction_service.explain.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/prediction_service.predict.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/prediction_service.raw_predict.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/specialist_pool_service.create_specialist_pool.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/specialist_pool_service.delete_specialist_pool.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/specialist_pool_service.get_specialist_pool.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/specialist_pool_service.list_specialist_pools.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/specialist_pool_service.update_specialist_pool.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.batch_create_tensorboard_runs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.batch_create_tensorboard_time_series.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.batch_read_tensorboard_time_series_data.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.create_tensorboard.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.create_tensorboard_experiment.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.create_tensorboard_run.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.create_tensorboard_time_series.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.delete_tensorboard.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.delete_tensorboard_experiment.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.delete_tensorboard_run.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.delete_tensorboard_time_series.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.export_tensorboard_time_series_data.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.get_tensorboard.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.get_tensorboard_experiment.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.get_tensorboard_run.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.get_tensorboard_time_series.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.list_tensorboard_experiments.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.list_tensorboard_runs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.list_tensorboard_time_series.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.list_tensorboards.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.read_tensorboard_blob_data.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.read_tensorboard_time_series_data.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.read_tensorboard_usage.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.update_tensorboard.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.update_tensorboard_experiment.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.update_tensorboard_run.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.update_tensorboard_time_series.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.write_tensorboard_experiment_data.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.write_tensorboard_run_data.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.add_trial_measurement.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.check_trial_early_stopping_state.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.complete_trial.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.create_study.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.create_trial.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.delete_study.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.delete_trial.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.get_study.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.get_trial.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.list_optimal_trials.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.list_studies.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.list_trials.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.lookup_study.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.stop_trial.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.suggest_trials.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/index.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/dataset_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/dataset_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/dataset_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/migration_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/migration_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/migration_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/pipeline_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/pipeline_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/pipeline_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/vizier_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/vizier_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/vizier_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_dataset_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_endpoint_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_featurestore_online_serving_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_featurestore_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_index_endpoint_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_index_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_job_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_metadata_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_migration_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_model_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_pipeline_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_prediction_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_specialist_pool_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_tensorboard_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_vizier_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/webpack.config.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/.eslintignore create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/linkinator.config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/package.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/artifact.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/context.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_item.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/entity_type.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/env_var.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/event.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/execution.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_selector.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/io.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_state.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/match_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_store.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/migration_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/nas_job.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/operation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_failure_policy.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/saved_query.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/service_networking.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/study.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/types.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/value.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/vizier_service.proto create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.create_dataset.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.delete_dataset.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.export_data.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.get_annotation_spec.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.get_dataset.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.import_data.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.list_annotations.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.list_data_items.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.list_datasets.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.list_saved_queries.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.search_data_items.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.update_dataset.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.create_deployment_resource_pool.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.delete_deployment_resource_pool.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.get_deployment_resource_pool.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.list_deployment_resource_pools.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.query_deployed_models.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.create_endpoint.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.delete_endpoint.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.deploy_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.get_endpoint.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.list_endpoints.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.undeploy_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.update_endpoint.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_online_serving_service.read_feature_values.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_online_serving_service.streaming_read_feature_values.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_online_serving_service.write_feature_values.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.batch_create_features.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.batch_read_feature_values.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.create_entity_type.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.create_feature.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.create_featurestore.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.delete_entity_type.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.delete_feature.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.delete_feature_values.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.delete_featurestore.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.export_feature_values.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.get_entity_type.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.get_feature.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.get_featurestore.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.import_feature_values.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.list_entity_types.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.list_features.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.list_featurestores.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.search_features.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.update_entity_type.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.update_feature.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.update_featurestore.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_endpoint_service.delete_index_endpoint.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_endpoint_service.deploy_index.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_endpoint_service.get_index_endpoint.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_endpoint_service.list_index_endpoints.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_endpoint_service.mutate_deployed_index.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_endpoint_service.undeploy_index.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_endpoint_service.update_index_endpoint.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_service.create_index.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_service.delete_index.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_service.get_index.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_service.list_indexes.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_service.remove_datapoints.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_service.update_index.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_service.upsert_datapoints.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.cancel_batch_prediction_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.cancel_custom_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.cancel_data_labeling_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.cancel_hyperparameter_tuning_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.cancel_nas_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.create_batch_prediction_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.create_custom_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.create_data_labeling_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.create_hyperparameter_tuning_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.create_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.create_nas_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.delete_batch_prediction_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.delete_custom_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.delete_data_labeling_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.delete_hyperparameter_tuning_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.delete_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.delete_nas_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.get_batch_prediction_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.get_custom_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.get_data_labeling_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.get_hyperparameter_tuning_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.get_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.get_nas_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.get_nas_trial_detail.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.list_batch_prediction_jobs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.list_custom_jobs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.list_data_labeling_jobs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.list_hyperparameter_tuning_jobs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.list_model_deployment_monitoring_jobs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.list_nas_jobs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.list_nas_trial_details.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.pause_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.resume_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.search_model_deployment_monitoring_stats_anomalies.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.update_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/match_service.find_neighbors.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/match_service.read_index_datapoints.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.add_context_artifacts_and_executions.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.add_context_children.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.add_execution_events.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.create_artifact.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.create_context.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.create_execution.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.create_metadata_schema.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.create_metadata_store.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.delete_artifact.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.delete_context.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.delete_execution.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.delete_metadata_store.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.get_artifact.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.get_context.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.get_execution.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.get_metadata_schema.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.get_metadata_store.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.list_artifacts.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.list_contexts.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.list_executions.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.list_metadata_schemas.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.list_metadata_stores.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.purge_artifacts.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.purge_contexts.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.purge_executions.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.query_artifact_lineage_subgraph.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.query_context_lineage_subgraph.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.query_execution_inputs_and_outputs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.remove_context_children.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.update_artifact.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.update_context.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.update_execution.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/migration_service.batch_migrate_resources.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/migration_service.search_migratable_resources.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.batch_import_evaluated_annotations.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.batch_import_model_evaluation_slices.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.copy_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.delete_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.delete_model_version.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.export_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.get_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.get_model_evaluation.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.get_model_evaluation_slice.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.import_model_evaluation.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.list_model_evaluation_slices.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.list_model_evaluations.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.list_model_versions.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.list_models.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.merge_version_aliases.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.update_explanation_dataset.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.update_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.upload_model.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.cancel_pipeline_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.cancel_training_pipeline.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.create_pipeline_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.create_training_pipeline.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.delete_pipeline_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.delete_training_pipeline.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.get_pipeline_job.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.get_training_pipeline.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.list_pipeline_jobs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.list_training_pipelines.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/prediction_service.explain.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/prediction_service.predict.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/prediction_service.raw_predict.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/schedule_service.create_schedule.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/schedule_service.delete_schedule.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/schedule_service.get_schedule.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/schedule_service.list_schedules.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/schedule_service.pause_schedule.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/schedule_service.resume_schedule.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/specialist_pool_service.create_specialist_pool.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/specialist_pool_service.delete_specialist_pool.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/specialist_pool_service.get_specialist_pool.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/specialist_pool_service.list_specialist_pools.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/specialist_pool_service.update_specialist_pool.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_runs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_time_series.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.batch_read_tensorboard_time_series_data.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.create_tensorboard.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.create_tensorboard_experiment.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.create_tensorboard_run.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.create_tensorboard_time_series.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.delete_tensorboard.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_experiment.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_run.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_time_series.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.get_tensorboard.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.get_tensorboard_experiment.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.get_tensorboard_run.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.get_tensorboard_time_series.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.list_tensorboard_experiments.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.list_tensorboard_runs.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.list_tensorboard_time_series.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.list_tensorboards.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.read_tensorboard_blob_data.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.read_tensorboard_time_series_data.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.read_tensorboard_usage.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.update_tensorboard.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.update_tensorboard_experiment.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.update_tensorboard_run.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.update_tensorboard_time_series.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.write_tensorboard_experiment_data.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.write_tensorboard_run_data.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.add_trial_measurement.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.complete_trial.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.create_study.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.create_trial.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.delete_study.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.delete_trial.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.get_study.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.get_trial.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.list_optimal_trials.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.list_studies.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.list_trials.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.lookup_study.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.stop_trial.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.suggest_trials.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/index.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_dataset_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_deployment_resource_pool_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_endpoint_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_job_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_match_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_metadata_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_migration_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_model_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_pipeline_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_prediction_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_schedule_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_tensorboard_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_vizier_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/webpack.config.js diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/.eslintignore b/owl-bot-staging/google-cloud-aiplatform/v1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/.eslintrc.json b/owl-bot-staging/google-cloud-aiplatform/v1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/.gitignore b/owl-bot-staging/google-cloud-aiplatform/v1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/.jsdoc.js b/owl-bot-staging/google-cloud-aiplatform/v1/.jsdoc.js new file mode 100644 index 00000000000..c805f17d6a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/aiplatform', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/.mocharc.js b/owl-bot-staging/google-cloud-aiplatform/v1/.mocharc.js new file mode 100644 index 00000000000..1a38f257db7 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/google-cloud-aiplatform/v1/.prettierrc.js b/owl-bot-staging/google-cloud-aiplatform/v1/.prettierrc.js new file mode 100644 index 00000000000..55639e70f9e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/google-cloud-aiplatform/v1/README.md b/owl-bot-staging/google-cloud-aiplatform/v1/README.md new file mode 100644 index 00000000000..7f057918e1b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/README.md @@ -0,0 +1 @@ +Aiplatform: Nodejs Client diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/linkinator.config.json b/owl-bot-staging/google-cloud-aiplatform/v1/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/package.json b/owl-bot-staging/google-cloud-aiplatform/v1/package.json new file mode 100644 index 00000000000..fd49b56f91c --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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.7" + }, + "devDependencies": { + "@types/mocha": "^10.0.1", + "@types/node": "^18.11.18", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.1", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.1", + "jsdoc-region-tag": "^2.0.1", + "linkinator": "^4.1.2", + "mocha": "^10.2.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.1", + "ts-loader": "^8.4.0", + "typescript": "^4.8.4", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/accelerator_type.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/accelerator_type.proto new file mode 100644 index 00000000000..f06cfb9df9e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/accelerator_type.proto @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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; + + // Nvidia L4 GPU. + NVIDIA_L4 = 11; + + // TPU v2. + TPU_V2 = 6; + + // TPU v3. + TPU_V3 = 7; + + // TPU v4. + TPU_V4_POD = 10; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/annotation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/annotation.proto new file mode 100644 index 00000000000..2a9a0cca69c --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/annotation.proto @@ -0,0 +1,96 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/annotation_spec.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/annotation_spec.proto new file mode 100644 index 00000000000..fbb8094325b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/annotation_spec.proto @@ -0,0 +1,57 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/artifact.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/artifact.proto new file mode 100644 index 00000000000..77ba15c1c50 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/artifact.proto @@ -0,0 +1,112 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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. + // Top level metadata keys' heading and trailing spaces will be trimmed. + // 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto new file mode 100644 index 00000000000..5388cd02886 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto @@ -0,0 +1,455 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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]; + } + + // Configuration defining how to transform batch prediction input instances to + // the instances that the Model accepts. + message InstanceConfig { + // The format of the instance that the Model accepts. Vertex AI will + // convert compatible + // [batch prediction input instance + // formats][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.instances_format] + // to the specified format. + // + // Supported values are: + // + // * `object`: Each input is converted to JSON object format. + // * For `bigquery`, each row is converted to an object. + // * For `jsonl`, each line of the JSONL input must be an object. + // * Does not apply to `csv`, `file-list`, `tf-record`, or + // `tf-record-gzip`. + // + // * `array`: Each input is converted to JSON array format. + // * For `bigquery`, each row is converted to an array. The order + // of columns is determined by the BigQuery column order, unless + // [included_fields][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.included_fields] + // is populated. + // [included_fields][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.included_fields] + // must be populated for specifying field orders. + // * For `jsonl`, if each line of the JSONL input is an object, + // [included_fields][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.included_fields] + // must be populated for specifying field orders. + // * Does not apply to `csv`, `file-list`, `tf-record`, or + // `tf-record-gzip`. + // + // If not specified, Vertex AI converts the batch prediction input as + // follows: + // + // * For `bigquery` and `csv`, the behavior is the same as `array`. The + // order of columns is the same as defined in the file or table, unless + // [included_fields][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.included_fields] + // is populated. + // * For `jsonl`, the prediction instance format is determined by + // each line of the input. + // * For `tf-record`/`tf-record-gzip`, each record will be converted to + // an object in the format of `{"b64": }`, where `` is + // the Base64-encoded string of the content of the record. + // * For `file-list`, each file in the list will be converted to an + // object in the format of `{"b64": }`, where `` is + // the Base64-encoded string of the content of the file. + string instance_type = 1; + + // The name of the field that is considered as a key. + // + // The values identified by the key field is not included in the transformed + // instances that is sent to the Model. This is similar to + // specifying this name of the field in + // [excluded_fields][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.excluded_fields]. + // In addition, the batch prediction output will not include the instances. + // Instead the output will only include the value of the key field, in a + // field named `key` in the output: + // + // * For `jsonl` output format, the output will have a `key` field + // instead of the `instance` field. + // * For `csv`/`bigquery` output format, the output will have have a `key` + // column instead of the instance feature columns. + // + // The input must be JSONL with objects at each line, CSV, BigQuery + // or TfRecord. + string key_field = 2; + + // Fields that will be included in the prediction instance that is + // sent to the Model. + // + // If + // [instance_type][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.instance_type] + // is `array`, the order of field names in included_fields also determines + // the order of the values in the array. + // + // When included_fields is populated, + // [excluded_fields][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.excluded_fields] + // must be empty. + // + // The input must be JSONL with objects at each line, CSV, BigQuery + // or TfRecord. + repeated string included_fields = 3; + + // Fields that will be excluded in the prediction instance that is + // sent to the Model. + // + // Excluded will be attached to the batch prediction output if + // [key_field][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.key_field] + // is not specified. + // + // When excluded_fields is populated, + // [included_fields][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.included_fields] + // must be empty. + // + // The input must be JSONL with objects at each line, CSV, BigQuery + // or TfRecord. + repeated string excluded_fields = 4; + } + + // 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 resource 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. + // Example: `projects/{project}/locations/{location}/models/{model}@2` + // or + // `projects/{project}/locations/{location}/models/{model}@golden` + // if no version is specified, the default version will be deployed. + 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]; + + // Configuration for how to convert batch prediction input instances to the + // prediction instances that are sent to the Model. + InstanceConfig instance_config = 27; + + // 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; + + // 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 Google Cloud 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.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 Google Cloud 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; + + // For custom-trained Models and AutoML Tabular Models, the container of the + // DeployedModel instances will send `stderr` and `stdout` streams to + // Cloud Logging by default. Please note that the logs incur cost, + // which are subject to [Cloud Logging + // pricing](https://cloud.google.com/logging/pricing). + // + // User can disable container logging by setting this flag to true. + bool disable_container_logging = 34; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto new file mode 100644 index 00000000000..033c13f8a63 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto @@ -0,0 +1,50 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/context.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/context.proto new file mode 100644 index 00000000000..dfbf62d3065 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/context.proto @@ -0,0 +1,97 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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. + // Top level metadata keys' heading and trailing spaces will be trimmed. + // 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/custom_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/custom_job.proto new file mode 100644 index 00000000000..10be55ef321 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/custom_job.proto @@ -0,0 +1,321 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 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. +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]; + + // Optional. Whether you want Vertex AI to enable access to the customized + // dashboard in training chief container. + // + // If set to `true`, you can access the dashboard 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_dashboard_access = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Experiment associated with this job. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadataStores}/contexts/{experiment-name}` + string experiment = 17 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; + + // Optional. The Experiment Run associated with this job. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadataStores}/contexts/{experiment-name}-{experiment-run-name}` + string experiment_run = 18 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; +} + +// 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/data_item.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/data_item.proto new file mode 100644 index 00000000000..e8a936b0796 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/data_item.proto @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/data_labeling_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/data_labeling_job.proto new file mode 100644 index 00000000000..afcc035396e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/data_labeling_job.proto @@ -0,0 +1,210 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/dataset.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/dataset.proto new file mode 100644 index 00000000000..bca97b5b9d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/dataset.proto @@ -0,0 +1,201 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/saved_query.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the Dataset. + string description = 16; + + // 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; + + // All SavedQueries belong to the Dataset will be returned in List/Get + // Dataset response. The annotation_specs field + // will not be populated except for UI cases which will only use + // [annotation_spec_count][google.cloud.aiplatform.v1.SavedQuery.annotation_spec_count]. + // In CreateDataset request, a SavedQuery is created together if + // this field is set, up to one SavedQuery can be set in CreateDatasetRequest. + // The SavedQuery should not contain any AnnotationSpec. + repeated SavedQuery saved_queries = 9; + + // 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; + + // Output only. The resource name of the Artifact that was created in + // MetadataStore when creating the Dataset. The Artifact resource name pattern + // is + // `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`. + string metadata_artifact = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// 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; + + // Labels that will be applied to newly imported Annotations. If two + // Annotations are identical, one of them will be deduped. Two Annotations are + // considered identical if their + // [payload][google.cloud.aiplatform.v1.Annotation.payload], + // [payload_schema_uri][google.cloud.aiplatform.v1.Annotation.payload_schema_uri] + // and all of their [labels][google.cloud.aiplatform.v1.Annotation.labels] are + // the same. 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 annotation_labels = 3; + + // 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; + } + + // The instructions how the export data should be split between the + // training, validation and test sets. + oneof split { + // Split based on fractions defining the size of each set. + ExportFractionSplit fraction_split = 5; + } + + // An expression for filtering what part of the Dataset is to be exported. + // Only Annotations 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; +} + +// Assigns the input data to training, validation, and test sets as per the +// given fractions. Any of `training_fraction`, `validation_fraction` and +// `test_fraction` may optionally be provided, they must sum to up to 1. If the +// provided ones sum to less than 1, the remainder is assigned to sets as +// decided by Vertex AI. If none of the fractions are set, by default roughly +// 80% of data is used for training, 10% for validation, and 10% for test. +message ExportFractionSplit { + // The fraction of the input data that is to be used to train the Model. + double training_fraction = 1; + + // The fraction of the input data that is to be used to validate the Model. + double validation_fraction = 2; + + // The fraction of the input data that is to be used to evaluate the Model. + double test_fraction = 3; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto new file mode 100644 index 00000000000..51f8e410404 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto @@ -0,0 +1,631 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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"; + } + + // Searches DataItems in a Dataset. + rpc SearchDataItems(SearchDataItemsRequest) + returns (SearchDataItemsResponse) { + option (google.api.http) = { + get: "/v1/{dataset=projects/*/locations/*/datasets/*}:searchDataItems" + }; + } + + // 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.SearchDataItems][google.cloud.aiplatform.v1.DatasetService.SearchDataItems]. +message SearchDataItemsRequest { + // Expression that allows ranking results based on annotation's property. + message OrderByAnnotation { + // Required. Saved query of the Annotation. Only Annotations belong to this + // saved query will be considered for ordering. + string saved_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // A comma-separated list of annotation fields to order by, sorted in + // ascending order. Use "desc" after a field name for descending. Must also + // specify saved_query. + string order_by = 2; + } + + oneof order { + // A comma-separated list of data item fields to order by, sorted in + // ascending order. Use "desc" after a field name for descending. + string order_by_data_item = 12; + + // Expression that allows ranking results based on annotation's property. + OrderByAnnotation order_by_annotation = 13; + } + + // Required. The resource name of the Dataset from which to search DataItems. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}` + string dataset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + } + ]; + + // The resource name of a SavedQuery(annotation set in UI). + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` + // All of the search will be done in the context of this SavedQuery. + string saved_query = 2 [ + deprecated = true, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/SavedQuery" + } + ]; + + // The resource name of a DataLabelingJob. + // Format: + // `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + // If this field is set, all of the search will be done in the context of + // this DataLabelingJob. + string data_labeling_job = 3; + + // An expression for filtering the DataItem that will be returned. + // + // * `data_item_id` - for = or !=. + // * `labeled` - for = or !=. + // * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that + // have at least one annotation with annotation_spec_id = + // `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. + // + // For example: + // + // * `data_item=1` + // * `has_annotation(5)` + string data_item_filter = 4; + + // An expression for filtering the Annotations that will be returned per + // DataItem. + // * `annotation_spec_id` - for = or !=. + string annotations_filter = 5 [deprecated = true]; + + // An expression that specifies what Annotations will be returned per + // DataItem. Annotations satisfied either of the conditions will be returned. + // * `annotation_spec_id` - for = or !=. + // Must specify `saved_query_id=` - saved query id that annotations should + // belong to. + repeated string annotation_filters = 11; + + // Mask specifying which fields of + // [DataItemView][google.cloud.aiplatform.v1.DataItemView] to read. + google.protobuf.FieldMask field_mask = 6; + + // If set, only up to this many of Annotations will be returned per + // DataItemView. The maximum value is 1000. If not set, the maximum value will + // be used. + int32 annotations_limit = 7; + + // Requested page size. Server may return fewer results than requested. + // Default and maximum page size is 100. + int32 page_size = 8; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + string order_by = 9 [deprecated = true]; + + // A token identifying a page of results for the server to return + // Typically obtained via + // [SearchDataItemsResponse.next_page_token][google.cloud.aiplatform.v1.SearchDataItemsResponse.next_page_token] + // of the previous + // [DatasetService.SearchDataItems][google.cloud.aiplatform.v1.DatasetService.SearchDataItems] + // call. + string page_token = 10; +} + +// Response message for +// [DatasetService.SearchDataItems][google.cloud.aiplatform.v1.DatasetService.SearchDataItems]. +message SearchDataItemsResponse { + // The DataItemViews read. + repeated DataItemView data_item_views = 1; + + // A token to retrieve next page of results. + // Pass to + // [SearchDataItemsRequest.page_token][google.cloud.aiplatform.v1.SearchDataItemsRequest.page_token] + // to obtain that page. + string next_page_token = 2; +} + +// A container for a single DataItem and Annotations on it. +message DataItemView { + // The DataItem. + DataItem data_item = 1; + + // The Annotations on the DataItem. If too many Annotations should be returned + // for the DataItem, this field will be truncated per annotations_limit in + // request. If it was, then the has_truncated_annotations will be set to true. + repeated Annotation annotations = 2; + + // True if and only if the Annotations field has been truncated. It happens if + // more Annotations for this DataItem met the request's annotation_filter than + // are allowed to be returned by annotations_limit. + // Note that if Annotations field is not being returned due to field mask, + // then this field will not be set to true no matter how many Annotations are + // there. + bool has_truncated_annotations = 3; +} + +// 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/deployed_index_ref.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/deployed_index_ref.proto new file mode 100644 index 00000000000..5049c83b1b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/deployed_index_ref.proto @@ -0,0 +1,42 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/deployed_model_ref.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/deployed_model_ref.proto new file mode 100644 index 00000000000..c5b9bba39b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/deployed_model_ref.proto @@ -0,0 +1,42 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/encryption_spec.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/encryption_spec.proto new file mode 100644 index 00000000000..a8a73291a8d --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/encryption_spec.proto @@ -0,0 +1,38 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/endpoint.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/endpoint.proto new file mode 100644 index 00000000000..e014e10611f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/endpoint.proto @@ -0,0 +1,289 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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}" + pattern: "projects/{project}/locations/{location}/publishers/{publisher}/models/{model}" + }; + + // 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 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; + + // Optional. 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.field_behavior) = OPTIONAL, + (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 + // [JobService.CreateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.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]. + // Required except for Large Model Deploy use cases. + 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. + // Example: `projects/{project}/locations/{location}/models/{model}@2` + // or + // `projects/{project}/locations/{location}/models/{model}@golden` + // 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 + // Cloud Logging by default. Please note that the logs incur cost, + // which are subject to [Cloud Logging + // pricing](https://cloud.google.com/logging/pricing). + // + // User can disable container logging by setting this flag to true. + bool disable_container_logging = 15; + + // If true, online prediction access logs are sent to Cloud + // Logging. + // These logs are like standard server access logs, containing + // information like timestamp and latency for each prediction request. + // + // Note that 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/endpoint_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/endpoint_service.proto new file mode 100644 index 00000000000..6ac193dabf8 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/endpoint_service.proto @@ -0,0 +1,425 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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" + }; + } + + // Updates an existing deployed model. Updatable fields include + // `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, + // `disable_container_logging` (v1 only), and `enable_container_logging` + // (v1beta1 only). + rpc MutateDeployedModel(MutateDeployedModelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:mutateDeployedModel" + body: "*" + }; + option (google.api.method_signature) = + "endpoint,deployed_model,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "MutateDeployedModelResponse" + metadata_type: "MutateDeployedModelOperationMetadata" + }; + } +} + +// 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. + // + // If the first character is a letter, this value may be up to 63 characters, + // and valid characters are `[a-z0-9-]`. The last character must be a letter + // or number. + // + // If the first character is a number, this value may be up to 9 characters, + // and valid characters are `[0-9]` with no leading zeros. + // + // 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; +} + +// Request message for +// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1.EndpointService.MutateDeployedModel]. +message MutateDeployedModelRequest { + // Required. The name of the Endpoint resource into which to mutate a + // DeployedModel. 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 mutated within the Endpoint. Only the + // following fields can be mutated: + // + // * `min_replica_count` in either + // [DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources] or + // [AutomaticResources][google.cloud.aiplatform.v1.AutomaticResources] + // * `max_replica_count` in either + // [DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources] or + // [AutomaticResources][google.cloud.aiplatform.v1.AutomaticResources] + // * [autoscaling_metric_specs][google.cloud.aiplatform.v1.DedicatedResources.autoscaling_metric_specs] + // * `disable_container_logging` (v1 only) + // * `enable_container_logging` (v1beta1 only) + DeployedModel deployed_model = 2 [(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 = 4 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for +// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1.EndpointService.MutateDeployedModel]. +message MutateDeployedModelResponse { + // The DeployedModel that's being mutated. + DeployedModel deployed_model = 1; +} + +// Runtime operation information for +// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1.EndpointService.MutateDeployedModel]. +message MutateDeployedModelOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/entity_type.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/entity_type.proto new file mode 100644 index 00000000000..8e70ea2a37f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/entity_type.proto @@ -0,0 +1,98 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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]; + + // Optional. Config for data retention policy in offline storage. + // TTL in days for feature values that will be stored in offline storage. + // The Feature Store offline storage periodically removes obsolete feature + // values older than `offline_storage_ttl_days` since the feature generation + // time. If unset (or explicitly set to 0), default to 4000 days TTL. + int32 offline_storage_ttl_days = 10 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/env_var.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/env_var.proto new file mode 100644 index 00000000000..b548757213c --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/env_var.proto @@ -0,0 +1,42 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/evaluated_annotation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/evaluated_annotation.proto new file mode 100644 index 00000000000..2d74effd981 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/evaluated_annotation.proto @@ -0,0 +1,181 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "EvaluatedAnnotationProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// True positive, false positive, or false negative. +// +// EvaluatedAnnotation is only available under ModelEvaluationSlice with slice +// of `annotationSpec` dimension. +message EvaluatedAnnotation { + // Describes the type of the EvaluatedAnnotation. The type is determined + enum EvaluatedAnnotationType { + // Invalid value. + EVALUATED_ANNOTATION_TYPE_UNSPECIFIED = 0; + + // The EvaluatedAnnotation is a true positive. It has a prediction created + // by the Model and a ground truth Annotation which the prediction matches. + TRUE_POSITIVE = 1; + + // The EvaluatedAnnotation is false positive. It has a prediction created by + // the Model which does not match any ground truth annotation. + FALSE_POSITIVE = 2; + + // The EvaluatedAnnotation is false negative. It has a ground truth + // annotation which is not matched by any of the model created predictions. + FALSE_NEGATIVE = 3; + } + + // Output only. Type of the EvaluatedAnnotation. + EvaluatedAnnotationType type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The model predicted annotations. + // + // For true positive, there is one and only one prediction, which matches the + // only one ground truth annotation in + // [ground_truths][google.cloud.aiplatform.v1.EvaluatedAnnotation.ground_truths]. + // + // For false positive, there is one and only one prediction, which doesn't + // match any ground truth annotation of the corresponding + // [data_item_view_id][EvaluatedAnnotation.data_item_view_id]. + // + // For false negative, there are zero or more predictions which are similar to + // the only ground truth annotation in + // [ground_truths][google.cloud.aiplatform.v1.EvaluatedAnnotation.ground_truths] + // but not enough for a match. + // + // The schema of the prediction is stored in + // [ModelEvaluation.annotation_schema_uri][google.cloud.aiplatform.v1.ModelEvaluation.annotation_schema_uri] + repeated google.protobuf.Value predictions = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The ground truth Annotations, i.e. the Annotations that exist + // in the test data the Model is evaluated on. + // + // For true positive, there is one and only one ground truth annotation, which + // matches the only prediction in + // [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions]. + // + // For false positive, there are zero or more ground truth annotations that + // are similar to the only prediction in + // [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions], + // but not enough for a match. + // + // For false negative, there is one and only one ground truth annotation, + // which doesn't match any predictions created by the model. + // + // The schema of the ground truth is stored in + // [ModelEvaluation.annotation_schema_uri][google.cloud.aiplatform.v1.ModelEvaluation.annotation_schema_uri] + repeated google.protobuf.Value ground_truths = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The data item payload that the Model predicted this + // EvaluatedAnnotation on. + google.protobuf.Value data_item_payload = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. ID of the EvaluatedDataItemView under the same ancestor + // ModelEvaluation. The EvaluatedDataItemView consists of all ground truths + // and predictions on + // [data_item_payload][google.cloud.aiplatform.v1.EvaluatedAnnotation.data_item_payload]. + string evaluated_data_item_view_id = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Explanations of + // [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions]. + // Each element of the explanations indicates the explanation for one + // explanation Method. + // + // The attributions list in the + // [EvaluatedAnnotationExplanation.explanation][google.cloud.aiplatform.v1.EvaluatedAnnotationExplanation.explanation] + // object corresponds to the + // [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions] + // list. For example, the second element in the attributions list explains the + // second element in the predictions list. + repeated EvaluatedAnnotationExplanation explanations = 8; + + // Annotations of model error analysis results. + repeated ErrorAnalysisAnnotation error_analysis_annotations = 9; +} + +// Explanation result of the prediction produced by the Model. +message EvaluatedAnnotationExplanation { + // Explanation type. + // + // For AutoML Image Classification models, possible values are: + // + // * `image-integrated-gradients` + // * `image-xrai` + string explanation_type = 1; + + // Explanation attribution response details. + Explanation explanation = 2; +} + +// Model error analysis for each annotation. +message ErrorAnalysisAnnotation { + // Attributed items for a given annotation, typically representing neighbors + // from the training sets constrained by the query type. + message AttributedItem { + // The unique ID for each annotation. Used by FE to allocate the annotation + // in DB. + string annotation_resource_name = 1; + + // The distance of this item to the annotation. + double distance = 2; + } + + // The query type used for finding the attributed items. + enum QueryType { + // Unspecified query type for model error analysis. + QUERY_TYPE_UNSPECIFIED = 0; + + // Query similar samples across all classes in the dataset. + ALL_SIMILAR = 1; + + // Query similar samples from the same class of the input sample. + SAME_CLASS_SIMILAR = 2; + + // Query dissimilar samples from the same class of the input sample. + SAME_CLASS_DISSIMILAR = 3; + } + + // Attributed items for a given annotation, typically representing neighbors + // from the training sets constrained by the query type. + repeated AttributedItem attributed_items = 1; + + // The query type used for finding the attributed items. + QueryType query_type = 2; + + // The outlier score of this annotated item. Usually defined as the min of all + // distances from attributed items. + double outlier_score = 3; + + // The threshold used to determine if this annotation is an outlier or not. + double outlier_threshold = 4; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/event.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/event.proto new file mode 100644 index 00000000000..65e9d7a09b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/event.proto @@ -0,0 +1,81 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/execution.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/execution.proto new file mode 100644 index 00000000000..915c58dae7b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/execution.proto @@ -0,0 +1,118 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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. + // Top level metadata keys' heading and trailing spaces will be trimmed. + // 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/explanation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/explanation.proto new file mode 100644 index 00000000000..c1e3545c9c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/explanation.proto @@ -0,0 +1,501 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 + // attribution 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/explanation_metadata.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/explanation_metadata.proto new file mode 100644 index 00000000000..45f24d3a7f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/explanation_metadata.proto @@ -0,0 +1,423 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature.proto new file mode 100644 index 00000000000..327ec57d301 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature.proto @@ -0,0 +1,162 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 + // [SnapshotAnalysis][google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.SnapshotAnalysis] + // or + // [ImportFeaturesAnalysis][google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ImportFeaturesAnalysis] + // 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto new file mode 100644 index 00000000000..c1828a72650 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto @@ -0,0 +1,87 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature_selector.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature_selector.proto new file mode 100644 index 00000000000..9f6ff203a2d --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature_selector.proto @@ -0,0 +1,44 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore.proto new file mode 100644 index 00000000000..bcaf8ac3e91 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore.proto @@ -0,0 +1,152 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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; + + // Optional. The cpu utilization that the Autoscaler should be trying to + // achieve. This number is on a scale from 0 (no utilization) to 100 + // (total utilization), and is limited between 10 and 80. When a cluster's + // CPU utilization exceeds the target that you have set, Bigtable + // immediately adds nodes to the cluster. When CPU utilization is + // substantially lower than the target, Bigtable removes nodes. If not set + // or set to 0, default to 50. + int32 cpu_utilization_target = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // 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. The field should not + // co-exist with the field of `OnlineStoreReplicationConfig`. If both of it + // and OnlineStoreReplicationConfig are unset, the feature store 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. TTL in days for feature values that will be stored in online + // serving storage. The Feature Store online storage periodically removes + // obsolete feature values older than `online_storage_ttl_days` since the + // feature generation time. Note that `online_storage_ttl_days` should be less + // than or equal to `offline_storage_ttl_days` for each EntityType under a + // featurestore. If not set, default to 4000 days + int32 online_storage_ttl_days = 13 [(google.api.field_behavior) = OPTIONAL]; + + // 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto new file mode 100644 index 00000000000..a169e6c7144 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto @@ -0,0 +1,151 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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. + 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][google.cloud.aiplatform.v1.FeaturestoreService.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][google.cloud.aiplatform.v1.FeaturestoreService.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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto new file mode 100644 index 00000000000..6cc4e677546 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto @@ -0,0 +1,285 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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"; + } + + // 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: "/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:writeFeatureValues" + body: "*" + }; + option (google.api.method_signature) = "entity_type,payloads"; + } +} + +// Request message for +// [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1.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.v1.FeaturestoreOnlineServingService.WriteFeatureValues]. +message WriteFeatureValuesResponse {} + +// 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.EntityView.data][google.cloud.aiplatform.v1.ReadFeatureValuesResponse.EntityView.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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto new file mode 100644 index 00000000000..9249e3874ac --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto @@ -0,0 +1,1444 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/interval.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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" + }; + } + + // Delete Feature values from Featurestore. + // + // The progress of the deletion is tracked by the returned operation. The + // deleted feature values are guaranteed to be invisible to subsequent read + // operations after the operation is marked as successfully done. + // + // If a delete feature values operation fails, the feature values + // returned from reads and exports may be inconsistent. If consistency is + // required, the caller must retry the same delete request again and wait till + // the new operation returned is marked as successfully done. + rpc DeleteFeatureValues(DeleteFeatureValuesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:deleteFeatureValues" + body: "*" + }; + option (google.api.method_signature) = "entity_type"; + option (google.longrunning.operation_info) = { + response_type: "DeleteFeatureValuesResponse" + metadata_type: "DeleteFeatureValuesOperationMetadata" + }; + } + + // 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` + // * `online_storage_ttl_days` + 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; + + // The number rows that weren't ingested due to having feature timestamps + // outside the retention boundary. + int64 timestamp_outside_retention_rows_count = 4; +} + +// 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. + repeated EntityTypeSpec entity_type_specs = 7 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. 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 = 11 + [(google.api.field_behavior) = OPTIONAL]; +} + +// 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` + // * `offline_storage_ttl_days` + 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 128 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 source URI from where Feature values are imported. + repeated string source_uris = 4; + + // 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; + + // The number rows that weren't ingested due to having timestamps outside the + // retention boundary. + int64 timestamp_outside_retention_rows_count = 7; +} + +// 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 delete Feature values. +message DeleteFeatureValuesOperationMetadata { + // Operation metadata for Featurestore delete 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; +} + +// Request message for +// [FeaturestoreService.DeleteFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.DeleteFeatureValues]. +message DeleteFeatureValuesRequest { + // Message to select entity. + // If an entity id is selected, all the feature values corresponding to the + // entity id will be deleted, including the entityId. + message SelectEntity { + // Required. Selectors choosing feature values of which entity id to be + // deleted from the EntityType. + EntityIdSelector entity_id_selector = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // Message to select time range and feature. + // Values of the selected feature generated within an inclusive time range + // will be deleted. Using this option permanently deletes the feature values + // from the specified feature IDs within the specified time range. + // This might include data from the online storage. If you want to retain + // any deleted historical data in the online storage, you must re-ingest it. + message SelectTimeRangeAndFeature { + // Required. Select feature generated within a half-inclusive time range. + // The time range is lower inclusive and upper exclusive. + google.type.Interval time_range = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Selectors choosing which feature values to be deleted from the + // EntityType. + FeatureSelector feature_selector = 2 + [(google.api.field_behavior) = REQUIRED]; + + // If set, data will not be deleted from online storage. + // When time range is older than the data in online storage, setting this to + // be true will make the deletion have no impact on online serving. + bool skip_online_storage_delete = 3; + } + + // Defines options to select feature values to be deleted. + oneof DeleteOption { + // Select feature values to be deleted by specifying entities. + SelectEntity select_entity = 2; + + // Select feature values to be deleted by specifying time range and + // features. + SelectTimeRangeAndFeature select_time_range_and_feature = 3; + } + + // Required. The resource name of the EntityType grouping the Features for + // which values are being deleted from. 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" + } + ]; +} + +// Response message for +// [FeaturestoreService.DeleteFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.DeleteFeatureValues]. +message DeleteFeatureValuesResponse { + // Response message if the request uses the SelectEntity option. + message SelectEntity { + // The count of deleted entity rows in the offline storage. + // Each row corresponds to the combination of an entity ID and a timestamp. + // One entity ID can have multiple rows in the offline storage. + int64 offline_storage_deleted_entity_row_count = 1; + + // The count of deleted entities in the online storage. + // Each entity ID corresponds to one entity. + int64 online_storage_deleted_entity_count = 2; + } + + // Response message if the request uses the SelectTimeRangeAndFeature option. + message SelectTimeRangeAndFeature { + // The count of the features or columns impacted. + // This is the same as the feature count in the request. + int64 impacted_feature_count = 1; + + // The count of modified entity rows in the offline storage. + // Each row corresponds to the combination of an entity ID and a timestamp. + // One entity ID can have multiple rows in the offline storage. + // Within each row, only the features specified in the request are + // deleted. + int64 offline_storage_modified_entity_row_count = 2; + + // The count of modified entities in the online storage. + // Each entity ID corresponds to one entity. + // Within each entity, only the features specified in the request are + // deleted. + int64 online_storage_modified_entity_count = 3; + } + + // Response based on which delete option is specified in the + // request + oneof response { + // Response for request specifying the entities to delete + SelectEntity select_entity = 1; + + // Response for request specifying time range and feature + SelectTimeRangeAndFeature select_time_range_and_feature = 2; + } +} + +// Selector for entityId. Getting ids from the given source. +message EntityIdSelector { + // Details about the source data, including the location of the storage and + // the format. + oneof EntityIdsSource { + // Source of Csv + CsvSource csv_source = 3; + } + + // Source column that holds entity IDs. If not provided, entity IDs are + // extracted from the column named `entity_id`. + string entity_id_field = 5; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto new file mode 100644 index 00000000000..9699d36fcd4 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto @@ -0,0 +1,116 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index.proto new file mode 100644 index 00000000000..6f21672aa48 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index.proto @@ -0,0 +1,177 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_endpoint.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_endpoint.proto new file mode 100644 index 00000000000..9b4dd453297 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_endpoint.proto @@ -0,0 +1,285 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/cloud/aiplatform/v1/service_networking.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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]; + + // Optional. Configuration for private service connect. + // + // [network][google.cloud.aiplatform.v1.IndexEndpoint.network] and + // [private_service_connect_config][google.cloud.aiplatform.v1.IndexEndpoint.private_service_connect_config] + // are mutually exclusive. + PrivateServiceConnectConfig private_service_connect_config = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the deployed index will be accessible through public + // endpoint. + bool public_endpoint_enabled = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. If + // [public_endpoint_enabled][google.cloud.aiplatform.v1.IndexEndpoint.public_endpoint_enabled] + // is true, this field will be populated with the domain name to use for this + // index endpoint. + string public_endpoint_domain_name = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// 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 for SMALL shard: + // e2-standard-2 and all machine types available for MEDIUM and LARGE shard. + // + // Available machine types for MEDIUM shard: + // e2-standard-16 and all machine types available for LARGE shard. + // + // Available machine types for LARGE shard: + // e2-highmem-16, n2d-standard-32. + // + // n1-standard-16 and n1-standard-32 are still available, but we recommend + // e2-standard-16 and e2-highmem-16 for cost efficiency. + DedicatedResources dedicated_resources = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, private endpoint's access logs are sent to Cloud + // Logging. + // + // These logs are like standard server access logs, containing + // information like timestamp and latency for each MatchRequest. + // + // Note that 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 should 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_endpoint_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_endpoint_service.proto new file mode 100644 index 00000000000..36fb8e297ee --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_endpoint_service.proto @@ -0,0 +1,362 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_service.proto new file mode 100644 index 00000000000..29f10f47878 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_service.proto @@ -0,0 +1,356 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/io.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/io.proto new file mode 100644 index 00000000000..016601d8658 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/io.proto @@ -0,0 +1,109 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/job_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/job_service.proto new file mode 100644 index 00000000000..a9feae428ba --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/job_service.proto @@ -0,0 +1,1372 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/nas_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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // 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 NasJob + rpc CreateNasJob(CreateNasJobRequest) returns (NasJob) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/nasJobs" + body: "nas_job" + }; + option (google.api.method_signature) = "parent,nas_job"; + } + + // Gets a NasJob + rpc GetNasJob(GetNasJobRequest) returns (NasJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/nasJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists NasJobs in a Location. + rpc ListNasJobs(ListNasJobsRequest) returns (ListNasJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/nasJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a NasJob. + rpc DeleteNasJob(DeleteNasJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/nasJobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Cancels a NasJob. + // Starts asynchronous cancellation on the NasJob. The server + // makes a best effort to cancel the job, but success is not + // guaranteed. Clients can use + // [JobService.GetNasJob][google.cloud.aiplatform.v1.JobService.GetNasJob] or + // other methods to check whether the cancellation succeeded or whether the + // job completed despite cancellation. On successful cancellation, + // the NasJob is not deleted; instead it becomes a job with + // a [NasJob.error][google.cloud.aiplatform.v1.NasJob.error] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`, and + // [NasJob.state][google.cloud.aiplatform.v1.NasJob.state] is set to + // `CANCELLED`. + rpc CancelNasJob(CancelNasJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/nasJobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a NasTrialDetail. + rpc GetNasTrialDetail(GetNasTrialDetailRequest) returns (NasTrialDetail) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/nasJobs/*/nasTrialDetails/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List top NasTrialDetails of a NasJob. + rpc ListNasTrialDetails(ListNasTrialDetailsRequest) + returns (ListNasTrialDetailsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/nasJobs/*}/nasTrialDetails" + }; + option (google.api.method_signature) = "parent"; + } + + // 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. + // * `labels` supports general map functions that is: + // `labels.key=value` - key:value equality + // `labels.key:* - key existence + // + // 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"` + // * `labels.keyA=valueA` + // * `labels.keyB:*` + 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. + // * `labels` supports general map functions that is: + // `labels.key=value` - key:value equality + // `labels.key:* - key existence + // + // 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"` + // * `labels.keyA=valueA` + // * `labels.keyB:*` + 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. + // * `labels` supports general map functions that is: + // `labels.key=value` - key:value equality + // `labels.key:* - key existence + // + // 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"` + // * `labels.keyA=valueA` + // * `labels.keyB:*` + 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.CreateNasJob][google.cloud.aiplatform.v1.JobService.CreateNasJob]. +message CreateNasJobRequest { + // Required. The resource name of the Location to create the NasJob 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 NasJob to create. + NasJob nas_job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [JobService.GetNasJob][google.cloud.aiplatform.v1.JobService.GetNasJob]. +message GetNasJobRequest { + // Required. The name of the NasJob resource. + // Format: + // `projects/{project}/locations/{location}/nasJobs/{nas_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NasJob" + } + ]; +} + +// Request message for +// [JobService.ListNasJobs][google.cloud.aiplatform.v1.JobService.ListNasJobs]. +message ListNasJobsRequest { + // Required. The resource name of the Location to list the NasJobs + // 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. + // * `labels` supports general map functions that is: + // `labels.key=value` - key:value equality + // `labels.key:* - key existence + // + // 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"` + // * `labels.keyA=valueA` + // * `labels.keyB:*` + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListNasJobsResponse.next_page_token][google.cloud.aiplatform.v1.ListNasJobsResponse.next_page_token] + // of the previous + // [JobService.ListNasJobs][google.cloud.aiplatform.v1.JobService.ListNasJobs] + // call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for +// [JobService.ListNasJobs][google.cloud.aiplatform.v1.JobService.ListNasJobs] +message ListNasJobsResponse { + // List of NasJobs in the requested page. + // [NasJob.nas_job_output][google.cloud.aiplatform.v1.NasJob.nas_job_output] + // of the jobs will not be returned. + repeated NasJob nas_jobs = 1; + + // A token to retrieve the next page of results. + // Pass to + // [ListNasJobsRequest.page_token][google.cloud.aiplatform.v1.ListNasJobsRequest.page_token] + // to obtain that page. + string next_page_token = 2; +} + +// Request message for +// [JobService.DeleteNasJob][google.cloud.aiplatform.v1.JobService.DeleteNasJob]. +message DeleteNasJobRequest { + // Required. The name of the NasJob resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/nasJobs/{nas_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NasJob" + } + ]; +} + +// Request message for +// [JobService.CancelNasJob][google.cloud.aiplatform.v1.JobService.CancelNasJob]. +message CancelNasJobRequest { + // Required. The name of the NasJob to cancel. + // Format: + // `projects/{project}/locations/{location}/nasJobs/{nas_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NasJob" + } + ]; +} + +// Request message for +// [JobService.GetNasTrialDetail][google.cloud.aiplatform.v1.JobService.GetNasTrialDetail]. +message GetNasTrialDetailRequest { + // Required. The name of the NasTrialDetail resource. + // Format: + // `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NasTrialDetail" + } + ]; +} + +// Request message for +// [JobService.ListNasTrialDetails][google.cloud.aiplatform.v1.JobService.ListNasTrialDetails]. +message ListNasTrialDetailsRequest { + // Required. The name of the NasJob resource. + // Format: + // `projects/{project}/locations/{location}/nasJobs/{nas_job}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NasJob" + } + ]; + + // The standard list page size. + int32 page_size = 2; + + // The standard list page token. + // Typically obtained via + // [ListNasTrialDetailsResponse.next_page_token][google.cloud.aiplatform.v1.ListNasTrialDetailsResponse.next_page_token] + // of the previous + // [JobService.ListNasTrialDetails][google.cloud.aiplatform.v1.JobService.ListNasTrialDetails] + // call. + string page_token = 3; +} + +// Response message for +// [JobService.ListNasTrialDetails][google.cloud.aiplatform.v1.JobService.ListNasTrialDetails] +message ListNasTrialDetailsResponse { + // List of top NasTrials in the requested page. + repeated NasTrialDetail nas_trial_details = 1; + + // A token to retrieve the next page of results. + // Pass to + // [ListNasTrialDetailsRequest.page_token][google.cloud.aiplatform.v1.ListNasTrialDetailsRequest.page_token] + // to obtain that page. + string next_page_token = 2; +} + +// 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. + // * `labels` supports general map functions that is: + // `labels.key=value` - key:value equality + // `labels.key:* - key existence + // + // 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"` + // * `labels.keyA=valueA` + // * `labels.keyB:*` + 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 effect 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. + // * `labels` supports general map functions that is: + // `labels.key=value` - key:value equality + // `labels.key:* - key existence + // + // 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"` + // * `labels.keyA=valueA` + // * `labels.keyB:*` + 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/job_state.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/job_state.proto new file mode 100644 index 00000000000..e152ca74346 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/job_state.proto @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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. Only jobs in the `RUNNING` state can be updated. + // After updating, the job goes back to the `RUNNING` state. + JOB_STATE_UPDATING = 10; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/lineage_subgraph.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/lineage_subgraph.proto new file mode 100644 index 00000000000..67a06d98a9a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/lineage_subgraph.proto @@ -0,0 +1,42 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/machine_resources.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/machine_resources.proto new file mode 100644 index 00000000000..ae19c491235 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/machine_resources.proto @@ -0,0 +1,216 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto new file mode 100644 index 00000000000..6d5db1ea847 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto @@ -0,0 +1,39 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_schema.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_schema.proto new file mode 100644 index 00000000000..65f1bdb83e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_schema.proto @@ -0,0 +1,80 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_service.proto new file mode 100644 index 00000000000..9c1bcb09a6b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_service.proto @@ -0,0 +1,1389 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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"; + } + + // Remove a set of children contexts from a parent Context. If any of the + // child Contexts were NOT added to the parent Context, they are + // simply skipped. + rpc RemoveContextChildren(RemoveContextChildrenRequest) + returns (RemoveContextChildrenResponse) { + option (google.api.http) = { + post: "/v1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:removeContextChildren" + 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`). Maximum nested expression depth allowed + // is 5. + // + // For example: `display_name = "test" AND metadata.field1.bool_value = true`. + string filter = 4; + + // How the list of messages is ordered. Specify the values to order by and an + // ordering operation. The default sorting order is ascending. To specify + // descending order for a field, users append a " desc" suffix; for example: + // "foo desc, bar". + // Subfields are specified with a `.` character, such as foo.bar. + // see https://google.aip.dev/132#ordering for more details. + string order_by = 5; +} + +// 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`). Maximum nested expression depth allowed + // is 5. + // + // For example: `display_name = "test" AND metadata.field1.bool_value = true`. + string filter = 4; + + // How the list of messages is ordered. Specify the values to order by and an + // ordering operation. The default sorting order is ascending. To specify + // descending order for a field, users append a " desc" suffix; for example: + // "foo desc, bar". + // Subfields are specified with a `.` character, such as foo.bar. + // see https://google.aip.dev/132#ordering for more details. + string order_by = 5; +} + +// 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.DeleteContextChildrenRequest][]. +message RemoveContextChildrenRequest { + // 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.RemoveContextChildren][google.cloud.aiplatform.v1.MetadataService.RemoveContextChildren]. +message RemoveContextChildrenResponse {} + +// 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`). Maximum nested expression depth allowed + // is 5. + // + // For example: `display_name = "test" AND metadata.field1.bool_value = true`. + string filter = 4; + + // How the list of messages is ordered. Specify the values to order by and an + // ordering operation. The default sorting order is ascending. To specify + // descending order for a field, users append a " desc" suffix; for example: + // "foo desc, bar". + // Subfields are specified with a `.` character, such as foo.bar. + // see https://google.aip.dev/132#ordering for more details. + string order_by = 5; +} + +// 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`). Maximum nested expression depth allowed + // is 5. + // + // For example: `display_name = "test" AND metadata.field1.bool_value = true`. + string filter = 3; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_store.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_store.proto new file mode 100644 index 00000000000..a2f38308cb6 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_store.proto @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/migratable_resource.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/migratable_resource.proto new file mode 100644 index 00000000000..89108524992 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/migratable_resource.proto @@ -0,0 +1,155 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/migration_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/migration_service.proto new file mode 100644 index 00000000000..41605fa1f2e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/migration_service.proto @@ -0,0 +1,320 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model.proto new file mode 100644 index 00000000000..4872249c54a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model.proto @@ -0,0 +1,715 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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]; + } + + // Contains information about the original Model if this Model is a copy. + message OriginalModelInfo { + // Output only. The resource name of the Model this Model is a copy of, + // including the revision. Format: + // `projects/{project}/locations/{location}/models/{model_id}@{version_id}` + string model = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + } + + // 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 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 or Large 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 or Large 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][google.cloud.aiplatform.v1.PredictionService.Explain] after + // being [deployed][google.cloud.aiplatform.v1.EndpointService.DeployModel] if + // it is populated. The Model can be used for [batch + // explanation][google.cloud.aiplatform.v1.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][google.cloud.aiplatform.v1.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][google.cloud.aiplatform.v1.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; + + // Output only. Source of a model. It can either be automl training pipeline, + // custom training pipeline, BigQuery ML, or existing Vertex AI Model. + ModelSourceInfo model_source_info = 38 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If this Model is a copy of another Model, this contains info + // about the original. + OriginalModelInfo original_model_info = 34 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource name of the Artifact that was created in + // MetadataStore when creating the Model. The Artifact resource name pattern + // is + // `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`. + string metadata_artifact = 44 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// 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; +} + +// Detail description of the source information of the model. +message ModelSourceInfo { + // Source of the model. + enum ModelSourceType { + // Should not be used. + MODEL_SOURCE_TYPE_UNSPECIFIED = 0; + + // The Model is uploaded by automl training pipeline. + AUTOML = 1; + + // The Model is uploaded by user or custom training pipeline. + CUSTOM = 2; + + // The Model is registered and sync'ed from BigQuery ML. + BQML = 3; + + // The Model is saved or tuned from Model Garden. + MODEL_GARDEN = 4; + + // The Model is saved or tuned from Genie. + GENIE = 5; + } + + // Type of the model source. + ModelSourceType source_type = 1; + + // If this Model is copy of another Model. If true then + // [source_type][google.cloud.aiplatform.v1.ModelSourceInfo.source_type] + // pertains to the original. + bool copy = 2; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto new file mode 100644 index 00000000000..bfd4768385b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto @@ -0,0 +1,326 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_evaluation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_evaluation.proto new file mode 100644 index 00000000000..6114518bf04 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_evaluation.proto @@ -0,0 +1,119 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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][google.cloud.aiplatform.v1.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][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions], + // and + // [EvaluatedAnnotation.ground_truths][google.cloud.aiplatform.v1.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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto new file mode 100644 index 00000000000..059a3abdd47 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto @@ -0,0 +1,193 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 { + // Specification for how the data should be sliced. + message SliceSpec { + // Specification message containing the config for this SliceSpec. + // When `kind` is selected as `value` and/or `range`, only a single slice + // will be computed. + // When `all_values` is present, a separate slice will be computed for + // each possible label/value for the corresponding key in `config`. + // Examples, with feature zip_code with values 12345, 23334, 88888 and + // feature country with values "US", "Canada", "Mexico" in the dataset: + // + // Example 1: + // + // { + // "zip_code": { "value": { "float_value": 12345.0 } } + // } + // + // A single slice for any data with zip_code 12345 in the dataset. + // + // Example 2: + // + // { + // "zip_code": { "range": { "low": 12345, "high": 20000 } } + // } + // + // A single slice containing data where the zip_codes between 12345 and + // 20000 For this example, data with the zip_code of 12345 will be in this + // slice. + // + // Example 3: + // + // { + // "zip_code": { "range": { "low": 10000, "high": 20000 } }, + // "country": { "value": { "string_value": "US" } } + // } + // + // A single slice containing data where the zip_codes between 10000 and + // 20000 has the country "US". For this example, data with the zip_code of + // 12345 and country "US" will be in this slice. + // + // Example 4: + // + // { "country": {"all_values": { "value": true } } } + // + // Three slices are computed, one for each unique country in the dataset. + // + // Example 5: + // + // { + // "country": { "all_values": { "value": true } }, + // "zip_code": { "value": { "float_value": 12345.0 } } + // } + // + // Three slices are computed, one for each unique country in the dataset + // where the zip_code is also 12345. For this example, data with zip_code + // 12345 and country "US" will be in one slice, zip_code 12345 and country + // "Canada" in another slice, and zip_code 12345 and country "Mexico" in + // another slice, totaling 3 slices. + message SliceConfig { + oneof kind { + // A unique specific value for a given feature. + // Example: `{ "value": { "string_value": "12345" } }` + Value value = 1; + + // A range of values for a numerical feature. + // Example: `{"range":{"low":10000.0,"high":50000.0}}` + // will capture 12345 and 23334 in the slice. + Range range = 2; + + // If all_values is set to true, then all possible labels of the keyed + // feature will have another slice computed. + // Example: `{"all_values":{"value":true}}` + google.protobuf.BoolValue all_values = 3; + } + } + + // A range of values for slice(s). + // `low` is inclusive, `high` is exclusive. + message Range { + // Inclusive low value for the range. + float low = 1; + + // Exclusive high value for the range. + float high = 2; + } + + // Single value that supports strings and floats. + message Value { + oneof kind { + // String type. + string string_value = 1; + + // Float type. + float float_value = 2; + } + } + + // Mapping configuration for this SliceSpec. + // The key is the name of the feature. + // By default, the key will be prefixed by "instance" as a dictionary + // prefix for Vertex Batch Predictions output format. + map configs = 1; + } + + // 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]. + // * `slice`: This slice is a user customized slice defined by its + // SliceSpec. + 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. Specification for how the data was sliced. + SliceSpec slice_spec = 3 [(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]; + + // Output only. 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 tabular + // Models. + ModelExplanation model_explanation = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto new file mode 100644 index 00000000000..1978accfb37 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto @@ -0,0 +1,219 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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"; +option (google.api.resource_definition) = { + type: "monitoring.googleapis.com/NotificationChannel" + pattern: "projects/{project}/notificationChannels/{notification_channel}" +}; + +// 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_service.proto new file mode 100644 index 00000000000..3ab66e345c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_service.proto @@ -0,0 +1,870 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/encryption_spec.proto"; +import "google/cloud/aiplatform/v1/evaluated_annotation.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/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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][google.cloud.aiplatform.v1.DeployedModel] 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" + }; + } + + // Copies an already existing Vertex AI Model into the specified Location. + // The source Model must exist in the same Project. + // When copying custom Models, the users themselves are responsible for + // [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be + // region-agnostic, as well as making sure that any resources (e.g. files) it + // depends on remain accessible. + rpc CopyModel(CopyModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/models:copy" + body: "*" + }; + option (google.api.method_signature) = "parent,source_model"; + option (google.longrunning.operation_info) = { + response_type: "CopyModelResponse" + metadata_type: "CopyModelOperationMetadata" + }; + } + + // 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"; + } + + // Imports a list of externally generated EvaluatedAnnotations. + rpc BatchImportEvaluatedAnnotations(BatchImportEvaluatedAnnotationsRequest) + returns (BatchImportEvaluatedAnnotationsResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/models/*/evaluations/*/slices/*}:batchImport" + body: "*" + }; + option (google.api.method_signature) = "parent,evaluated_annotations"; + } + + // 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]; + + // Optional. The user-provided custom service account to use to do the model + // upload. If empty, [Vertex AI Service + // Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) + // will be used. Users uploading the Model must have the + // `iam.serviceAccounts.actAs` permission on this service account. Also, this + // account must belong to the project specified in the `parent` field and have + // all necessary read permissions. + string service_account = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// 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 + // [next_page_token][google.cloud.aiplatform.v1.ListModelVersionsResponse.next_page_token] + // of the previous + // [ListModelVersions][google.cloud.aiplatform.v1.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; + + // 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` + // + // Example: `update_time asc, create_time desc`. + string order_by = 6; +} + +// 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.CopyModel][google.cloud.aiplatform.v1.ModelService.CopyModel]. +message CopyModelRequest { + // If both fields are unset, a new Model will be created with a generated ID. + oneof destination_model { + // Optional. Copy source_model into a new Model with this ID. The ID 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 = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specify this field to copy source_model into this existing + // Model as a new version. Format: + // `projects/{project}/locations/{location}/models/{model}` + string parent_model = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + } + + // Required. The resource name of the Location into which to copy the Model. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The resource name of the Model to copy. That Model must be in the + // same Project. Format: + // `projects/{project}/locations/{location}/models/{model}` + string source_model = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // Customer-managed encryption key options. If this is set, + // then the Model copy will be encrypted with the provided encryption key. + EncryptionSpec encryption_spec = 3; +} + +// Details of +// [ModelService.CopyModel][google.cloud.aiplatform.v1.ModelService.CopyModel] +// operation. +message CopyModelOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; +} + +// Response message of +// [ModelService.CopyModel][google.cloud.aiplatform.v1.ModelService.CopyModel] +// operation. +message CopyModelResponse { + // The name of the copied 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 copied. + string model_version_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// 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.BatchImportEvaluatedAnnotations][google.cloud.aiplatform.v1.ModelService.BatchImportEvaluatedAnnotations] +message BatchImportEvaluatedAnnotationsRequest { + // Required. The name of the parent ModelEvaluationSlice resource. + // Format: + // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelEvaluationSlice" + } + ]; + + // Required. Evaluated annotations resource to be imported. + repeated EvaluatedAnnotation evaluated_annotations = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for +// [ModelService.BatchImportEvaluatedAnnotations][google.cloud.aiplatform.v1.ModelService.BatchImportEvaluatedAnnotations] +message BatchImportEvaluatedAnnotationsResponse { + // Output only. Number of EvaluatedAnnotations imported. + int32 imported_evaluated_annotations_count = 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/nas_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/nas_job.proto new file mode 100644 index 00000000000..ebffa6a70bf --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/nas_job.proto @@ -0,0 +1,306 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "NasJobProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Represents a Neural Architecture Search (NAS) job. +message NasJob { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/NasJob" + pattern: "projects/{project}/locations/{location}/nasJobs/{nas_job}" + }; + + // Output only. Resource name of the NasJob. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the NasJob. + // 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]; + + // Required. The specification of a NasJob. + NasJobSpec nas_job_spec = 4 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Output of the NasJob. + NasJobOutput nas_job_output = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed state of the job. + JobState state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the NasJob was created. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the NasJob for the first time entered the + // `JOB_STATE_RUNNING` state. + google.protobuf.Timestamp start_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the NasJob entered any of the following states: + // `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. + google.protobuf.Timestamp end_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the NasJob was most recently updated. + google.protobuf.Timestamp update_time = 10 + [(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 = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize NasJobs. + // + // 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 = 12; + + // Customer-managed encryption key options for a NasJob. + // If this is set, then all resources created by the NasJob + // will be encrypted with the provided encryption key. + EncryptionSpec encryption_spec = 13; + + // Optional. Enable a separation of Custom model training + // and restricted image training for tenant project. + bool enable_restricted_image_training = 14 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; +} + +// Represents a NasTrial details along with it's parameters. If there is a +// corresponding train NasTrial, the train NasTrial is also returned. +message NasTrialDetail { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/NasTrialDetail" + pattern: "projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}" + }; + + // Output only. Resource name of the NasTrialDetail. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The parameters for the NasJob NasTrial. + string parameters = 2; + + // The requested search NasTrial. + NasTrial search_trial = 3; + + // The train NasTrial corresponding to + // [search_trial][google.cloud.aiplatform.v1.NasTrialDetail.search_trial]. + // Only populated if + // [search_trial][google.cloud.aiplatform.v1.NasTrialDetail.search_trial] is + // used for training. + NasTrial train_trial = 4; +} + +// Represents the spec of a NasJob. +message NasJobSpec { + // The spec of multi-trial Neural Architecture Search (NAS). + message MultiTrialAlgorithmSpec { + // 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. + string metric_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The optimization goal of the metric. + GoalType goal = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Represent spec for search trials. + message SearchTrialSpec { + // Required. The spec of a search trial job. The same spec applies to + // all search trials. + CustomJobSpec search_trial_job_spec = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The maximum number of Neural Architecture Search (NAS) trials + // to run. + int32 max_trial_count = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The maximum number of trials to run in parallel. + int32 max_parallel_trial_count = 3 + [(google.api.field_behavior) = REQUIRED]; + + // The number of failed trials that need to be seen before failing + // the NasJob. + // + // If set to 0, Vertex AI decides how many trials must fail + // before the whole job fails. + int32 max_failed_trial_count = 4; + } + + // Represent spec for train trials. + message TrainTrialSpec { + // Required. The spec of a train trial job. The same spec applies to + // all train trials. + CustomJobSpec train_trial_job_spec = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The maximum number of trials to run in parallel. + int32 max_parallel_trial_count = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Frequency of search trials to start train stage. Top N + // [TrainTrialSpec.max_parallel_trial_count] + // search trials will be trained for every M + // [TrainTrialSpec.frequency] trials searched. + int32 frequency = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // The available types of multi-trial algorithms. + enum MultiTrialAlgorithm { + // Defaults to `REINFORCEMENT_LEARNING`. + MULTI_TRIAL_ALGORITHM_UNSPECIFIED = 0; + + // The Reinforcement Learning Algorithm for Multi-trial Neural + // Architecture Search (NAS). + REINFORCEMENT_LEARNING = 1; + + // The Grid Search Algorithm for Multi-trial Neural + // Architecture Search (NAS). + GRID_SEARCH = 2; + } + + // The multi-trial Neural Architecture Search (NAS) algorithm + // type. Defaults to `REINFORCEMENT_LEARNING`. + MultiTrialAlgorithm multi_trial_algorithm = 1; + + // Metric specs for the NAS job. + // Validation for this field is done at `multi_trial_algorithm_spec` field. + MetricSpec metric = 2; + + // Required. Spec for search trials. + SearchTrialSpec search_trial_spec = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Spec for train trials. Top N [TrainTrialSpec.max_parallel_trial_count] + // search trials will be trained for every M + // [TrainTrialSpec.frequency] trials searched. + TrainTrialSpec train_trial_spec = 4; + } + + // The Neural Architecture Search (NAS) algorithm specification. + oneof nas_algorithm_spec { + // The spec of multi-trial algorithms. + MultiTrialAlgorithmSpec multi_trial_algorithm_spec = 2; + } + + // The ID of the existing NasJob in the same Project and Location + // which will be used to resume search. search_space_spec and + // nas_algorithm_spec are obtained from previous NasJob hence should not + // provide them again for this NasJob. + string resume_nas_job_id = 3; + + // It defines the search space for Neural Architecture Search (NAS). + string search_space_spec = 1; +} + +// Represents a uCAIP NasJob output. +message NasJobOutput { + // The output of a multi-trial Neural Architecture Search (NAS) jobs. + message MultiTrialJobOutput { + // Output only. List of NasTrials that were started as part of search stage. + repeated NasTrial search_trials = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of NasTrials that were started as part of train stage. + repeated NasTrial train_trials = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The output of this Neural Architecture Search (NAS) job. + oneof output { + // Output only. The output of this multi-trial Neural Architecture Search + // (NAS) job. + MultiTrialJobOutput multi_trial_job_output = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} + +// Represents a uCAIP NasJob trial. +message NasTrial { + // Describes a NasTrial state. + enum State { + // The NasTrial state is unspecified. + STATE_UNSPECIFIED = 0; + + // Indicates that a specific NasTrial has been requested, but it has not yet + // been suggested by the service. + REQUESTED = 1; + + // Indicates that the NasTrial has been suggested. + ACTIVE = 2; + + // Indicates that the NasTrial should stop according to the service. + STOPPING = 3; + + // Indicates that the NasTrial is completed successfully. + SUCCEEDED = 4; + + // Indicates that the NasTrial should not be attempted again. + // The service will set a NasTrial to INFEASIBLE when it's done but missing + // the final_measurement. + INFEASIBLE = 5; + } + + // Output only. The identifier of the NasTrial assigned by the service. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed state of the NasTrial. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The final measurement containing the objective value. + Measurement final_measurement = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the NasTrial was started. + google.protobuf.Timestamp start_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the NasTrial's status changed to `SUCCEEDED` or + // `INFEASIBLE`. + google.protobuf.Timestamp end_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/operation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/operation.proto new file mode 100644 index 00000000000..8f8604124dd --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/operation.proto @@ -0,0 +1,55 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 Google Cloud 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto new file mode 100644 index 00000000000..fc33dacd304 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto @@ -0,0 +1,44 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto new file mode 100644 index 00000000000..fbad9ec38c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto @@ -0,0 +1,408 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 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 Google Cloud + // 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 + // [pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_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" + } + ]; + + // Output only. The names of the previously failed + // [CustomJob][google.cloud.aiplatform.v1.CustomJob] for the main container + // executions. The list includes the all attempts in chronological order. + repeated string failed_main_jobs = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The names of the previously failed + // [CustomJob][google.cloud.aiplatform.v1.CustomJob] for the + // pre-caching-check container executions. 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. The list + // includes the all attempts in chronological order. + repeated string failed_pre_caching_check_jobs = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The detailed info for a custom job executor. + message CustomJobDetail { + // 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" + } + ]; + + // Output only. The names of the previously failed + // [CustomJob][google.cloud.aiplatform.v1.CustomJob]. The list includes the + // all attempts in chronological order. + repeated string failed_jobs = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + 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 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto new file mode 100644 index 00000000000..39acd31657c --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto @@ -0,0 +1,450 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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. + // * `labels` supports general map functions that is: + // `labels.key=value` - key:value equality + // `labels.key:* - key existence + // + // 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_state.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_state.proto new file mode 100644 index 00000000000..b4837370065 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_state.proto @@ -0,0 +1,58 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/prediction_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/prediction_service.proto new file mode 100644 index 00000000000..16463dd48c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/prediction_service.proto @@ -0,0 +1,261 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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: "*" + additional_bindings { + post: "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}: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: "*" + additional_bindings { + post: "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}: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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/saved_query.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/saved_query.proto new file mode 100644 index 00000000000..55e5044b916 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/saved_query.proto @@ -0,0 +1,87 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto new file mode 100644 index 00000000000..e7f14c262ed --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto new file mode 100644 index 00000000000..cf6995dd65b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto new file mode 100644 index 00000000000..0916ae560ee --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto new file mode 100644 index 00000000000..acf3ad88820 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto new file mode 100644 index 00000000000..492d907d5ae --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto new file mode 100644 index 00000000000..cb3b732a487 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto new file mode 100644 index 00000000000..0cc58f06d82 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto new file mode 100644 index 00000000000..d849d0476b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto new file mode 100644 index 00000000000..4418c4926b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto new file mode 100644 index 00000000000..68b6d402c6d --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/params/paramspb;paramspb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto new file mode 100644 index 00000000000..6def9cb3d74 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/params/paramspb;paramspb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto new file mode 100644 index 00000000000..83e12562c4a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/params/paramspb;paramspb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto new file mode 100644 index 00000000000..d7778531d2b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/params/paramspb;paramspb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto new file mode 100644 index 00000000000..acf7ce0d937 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/params/paramspb;paramspb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto new file mode 100644 index 00000000000..721a080563c --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/params/paramspb;paramspb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto new file mode 100644 index 00000000000..a727b42bdde --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto new file mode 100644 index 00000000000..8a449d2b63a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto new file mode 100644 index 00000000000..5510a6c42e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto new file mode 100644 index 00000000000..cd49449dec0 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto new file mode 100644 index 00000000000..d3ebc73e043 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto new file mode 100644 index 00000000000..a16ce5c2166 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto new file mode 100644 index 00000000000..e5352b60d4d --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto new file mode 100644 index 00000000000..ea44f1e1d64 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto new file mode 100644 index 00000000000..d06450871ac --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto new file mode 100644 index 00000000000..415c03d7780 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto new file mode 100644 index 00000000000..697a9b61dbf --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto new file mode 100644 index 00000000000..a930bf140ca --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto new file mode 100644 index 00000000000..69e7e893c76 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto new file mode 100644 index 00000000000..b0fcfbf4342 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto new file mode 100644 index 00000000000..ad75ea17436 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto new file mode 100644 index 00000000000..e12c4940910 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto new file mode 100644 index 00000000000..642e9d50e7a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto new file mode 100644 index 00000000000..870066f7672 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto new file mode 100644 index 00000000000..67260122440 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto new file mode 100644 index 00000000000..c941b5c8c5f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto new file mode 100644 index 00000000000..f5eaa303a24 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/service_networking.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/service_networking.proto new file mode 100644 index 00000000000..55bd8c59666 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/service_networking.proto @@ -0,0 +1,38 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "ServiceNetworkingProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Represents configuration for private service connect. +message PrivateServiceConnectConfig { + // Required. If true, expose the IndexEndpoint via private service connect. + bool enable_private_service_connect = 1 + [(google.api.field_behavior) = REQUIRED]; + + // A list of Projects from which the forwarding rule will target the service + // attachment. + repeated string project_allowlist = 2; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/specialist_pool.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/specialist_pool.proto new file mode 100644 index 00000000000..158b0b20166 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/specialist_pool.proto @@ -0,0 +1,64 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/specialist_pool_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/specialist_pool_service.proto new file mode 100644 index 00000000000..cfd0b05c721 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/specialist_pool_service.proto @@ -0,0 +1,225 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/study.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/study.proto new file mode 100644 index 00000000000..5f998a027f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/study.proto @@ -0,0 +1,602 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 { + // Used in safe optimization to specify threshold levels and risk tolerance. + message SafetyMetricConfig { + // Safety threshold (boundary value between safe and unsafe). NOTE that if + // you leave SafetyMetricConfig unset, a default value of 0 will be used. + double safety_threshold = 1; + + // Desired minimum fraction of safe trials (over total number of trials) + // that should be targeted by the algorithm at any time during the + // study (best effort). This should be between 0.0 and 1.0 and a value of + // 0.0 means that there is no minimum and an algorithm proceeds without + // targeting any specific fraction. A value of 1.0 means that the + // algorithm attempts to only Suggest safe Trials. + optional double desired_min_safe_trials_fraction = 2; + } + + // 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]; + + // Used for safe search. In the case, the metric will be a safety + // metric. You must provide a separate metric for objective metric. + optional SafetyMetricConfig safety_config = 3; + } + + // 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; + + // ConvexAutomatedStoppingSpec by default only updates the trials that needs + // to be early stopped using a newly trained auto-regressive model. When + // this flag is set to True, all stopped trials from the beginning are + // potentially updated in terms of their `final_measurement`. Also, note + // that the training logic of autoregressive models is different in this + // case. Enabling this option has shown better results and this may be the + // default option in the future. + optional bool update_all_stopped_trials = 6; + } + + // 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard.proto new file mode 100644 index 00000000000..d22b961d795 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard.proto @@ -0,0 +1,96 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 Google Cloud 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; + + // Used to indicate if the TensorBoard instance is the default one. + // Each project & region can have at most one default TensorBoard instance. + // Creation of a default TensorBoard instance and updating an existing + // TensorBoard instance to be default will mark all other TensorBoard + // instances (if any) as non default. + bool is_default = 12; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_data.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_data.proto new file mode 100644 index 00000000000..291e88a0d0c --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_data.proto @@ -0,0 +1,104 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto new file mode 100644 index 00000000000..6ae26d3efad --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 cannot be 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. The 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 = 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_run.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_run.proto new file mode 100644 index 00000000000..1dc445e54bf --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_run.proto @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_service.proto new file mode 100644 index 00000000000..979f5aae94f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_service.proto @@ -0,0 +1,1133 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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"; + } + + // Returns a list of monthly active users for a given TensorBoard instance. + rpc ReadTensorboardUsage(ReadTensorboardUsageRequest) + returns (ReadTensorboardUsageResponse) { + option (google.api.http) = { + get: "/v1/{tensorboard=projects/*/locations/*/tensorboards/*}:readUsage" + }; + option (google.api.method_signature) = "tensorboard"; + } + + // 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 is returned. + // Otherwise, the number limit of data points is 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 is returned. Otherwise, 1000 + // data points is 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 is 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 is 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.GetTensorboardUsage][]. +message ReadTensorboardUsageRequest { + // Required. The name of the Tensorboard resource. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + string tensorboard = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Tensorboard" + } + ]; +} + +// Response message for +// [TensorboardService.ReadTensorboardUsage][google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardUsage]. +message ReadTensorboardUsageResponse { + // Per user usage data. + message PerUserUsageData { + // User's username + string username = 1; + + // Number of times the user has read data within the Tensorboard. + int64 view_count = 2; + } + + // Per month usage data + message PerMonthUsageData { + // Usage data for each user in the given month. + repeated PerUserUsageData user_usage_data = 1; + } + + // Maps year-month (YYYYMM) string to per month usage data. + map monthly_usage_data = 1; +} + +// 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 are + // returned. The maximum value is 100; values above 100 are 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 is overwritten if it's in the mask. If the + // user does not provide a mask then all fields are 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 becomes 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 are returned. The maximum value is 1000; values + // above 1000 are 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 is overwritten if it's in the mask. If the + // user does not provide a mask then all fields are 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 becomes 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 are + // returned. The maximum value is 1000; values above 1000 are 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 is overwritten if it's in the mask. If the + // user does not provide a mask then all fields are 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 becomes 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 are returned. The maximum value is 1000; values + // above 1000 are 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 is overwritten if it's in the mask. If the + // user does not provide a mask then all fields are 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 is 1000. Values must be between 1 and 10000. + // Values above 10000 are coerced to 10000. + int32 page_size = 3; + + // A page token, received from a previous + // [ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData] + // 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 is 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 + // [page_token][google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest.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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto new file mode 100644 index 00000000000..ef669d839d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto @@ -0,0 +1,112 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto new file mode 100644 index 00000000000..11c8f28fc06 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto @@ -0,0 +1,449 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +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 {@link google.cloud.aiplatform.v1.Dataset | 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 {@link google.cloud.aiplatform.v1.AnnotationSpec | 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 {@link google.cloud.aiplatform.v1.Dataset | 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 {@link google.cloud.aiplatform.v1.Dataset | 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 + * {@link google.cloud.aiplatform.v1.Dataset | 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 {@link google.cloud.aiplatform.v1.DataItem | 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 {@link google.cloud.aiplatform.v1.DataItem | 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 + * {@link google.cloud.aiplatform.v1.DataItem | 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; + } + /** + * Searches DataItems in a Dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.orderByDataItem + * A comma-separated list of data item fields to order by, sorted in + * ascending order. Use "desc" after a field name for descending. + * @param {google.cloud.aiplatform.v1.SearchDataItemsRequest.OrderByAnnotation} request.orderByAnnotation + * Expression that allows ranking results based on annotation's property. + * @param {string} request.dataset + * Required. The resource name of the Dataset from which to search DataItems. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {string} request.savedQuery + * The resource name of a SavedQuery(annotation set in UI). + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` + * All of the search will be done in the context of this SavedQuery. + * @param {string} request.dataLabelingJob + * The resource name of a DataLabelingJob. + * Format: + * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + * If this field is set, all of the search will be done in the context of + * this DataLabelingJob. + * @param {string} request.dataItemFilter + * An expression for filtering the DataItem that will be returned. + * + * * `data_item_id` - for = or !=. + * * `labeled` - for = or !=. + * * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that + * have at least one annotation with annotation_spec_id = + * `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. + * + * For example: + * + * * `data_item=1` + * * `has_annotation(5)` + * @param {string} request.annotationsFilter + * An expression for filtering the Annotations that will be returned per + * DataItem. + * * `annotation_spec_id` - for = or !=. + * @param {string[]} request.annotationFilters + * An expression that specifies what Annotations will be returned per + * DataItem. Annotations satisfied either of the conditions will be returned. + * * `annotation_spec_id` - for = or !=. + * Must specify `saved_query_id=` - saved query id that annotations should + * belong to. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields of + * {@link google.cloud.aiplatform.v1.DataItemView|DataItemView} to read. + * @param {number} request.annotationsLimit + * If set, only up to this many of Annotations will be returned per + * DataItemView. The maximum value is 1000. If not set, the maximum value will + * be used. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * Default and maximum page size is 100. + * @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 {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link google.cloud.aiplatform.v1.SearchDataItemsResponse.next_page_token|SearchDataItemsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1.DatasetService.SearchDataItems|DatasetService.SearchDataItems} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.aiplatform.v1.DataItemView | DataItemView}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchDataItemsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchDataItems( + request?: protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IDataItemView[], + protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest|null, + protos.google.cloud.aiplatform.v1.ISearchDataItemsResponse + ]>; + searchDataItems( + request: protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, + protos.google.cloud.aiplatform.v1.ISearchDataItemsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IDataItemView>): void; + searchDataItems( + request: protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, + protos.google.cloud.aiplatform.v1.ISearchDataItemsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IDataItemView>): void; + searchDataItems( + request?: protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, + protos.google.cloud.aiplatform.v1.ISearchDataItemsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IDataItemView>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, + protos.google.cloud.aiplatform.v1.ISearchDataItemsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IDataItemView>): + Promise<[ + protos.google.cloud.aiplatform.v1.IDataItemView[], + protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest|null, + protos.google.cloud.aiplatform.v1.ISearchDataItemsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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': request.dataset ?? '', + }); + this.initialize(); + return this.innerApiCalls.searchDataItems(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.orderByDataItem + * A comma-separated list of data item fields to order by, sorted in + * ascending order. Use "desc" after a field name for descending. + * @param {google.cloud.aiplatform.v1.SearchDataItemsRequest.OrderByAnnotation} request.orderByAnnotation + * Expression that allows ranking results based on annotation's property. + * @param {string} request.dataset + * Required. The resource name of the Dataset from which to search DataItems. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {string} request.savedQuery + * The resource name of a SavedQuery(annotation set in UI). + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` + * All of the search will be done in the context of this SavedQuery. + * @param {string} request.dataLabelingJob + * The resource name of a DataLabelingJob. + * Format: + * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + * If this field is set, all of the search will be done in the context of + * this DataLabelingJob. + * @param {string} request.dataItemFilter + * An expression for filtering the DataItem that will be returned. + * + * * `data_item_id` - for = or !=. + * * `labeled` - for = or !=. + * * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that + * have at least one annotation with annotation_spec_id = + * `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. + * + * For example: + * + * * `data_item=1` + * * `has_annotation(5)` + * @param {string} request.annotationsFilter + * An expression for filtering the Annotations that will be returned per + * DataItem. + * * `annotation_spec_id` - for = or !=. + * @param {string[]} request.annotationFilters + * An expression that specifies what Annotations will be returned per + * DataItem. Annotations satisfied either of the conditions will be returned. + * * `annotation_spec_id` - for = or !=. + * Must specify `saved_query_id=` - saved query id that annotations should + * belong to. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields of + * {@link google.cloud.aiplatform.v1.DataItemView|DataItemView} to read. + * @param {number} request.annotationsLimit + * If set, only up to this many of Annotations will be returned per + * DataItemView. The maximum value is 1000. If not set, the maximum value will + * be used. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * Default and maximum page size is 100. + * @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 {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link google.cloud.aiplatform.v1.SearchDataItemsResponse.next_page_token|SearchDataItemsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1.DatasetService.SearchDataItems|DatasetService.SearchDataItems} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.aiplatform.v1.DataItemView | DataItemView} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchDataItemsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchDataItemsStream( + request?: protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, + 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({ + 'dataset': request.dataset ?? '', + }); + const defaultCallSettings = this._defaults['searchDataItems']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchDataItems.createStream( + this.innerApiCalls.searchDataItems as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchDataItems`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.orderByDataItem + * A comma-separated list of data item fields to order by, sorted in + * ascending order. Use "desc" after a field name for descending. + * @param {google.cloud.aiplatform.v1.SearchDataItemsRequest.OrderByAnnotation} request.orderByAnnotation + * Expression that allows ranking results based on annotation's property. + * @param {string} request.dataset + * Required. The resource name of the Dataset from which to search DataItems. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {string} request.savedQuery + * The resource name of a SavedQuery(annotation set in UI). + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` + * All of the search will be done in the context of this SavedQuery. + * @param {string} request.dataLabelingJob + * The resource name of a DataLabelingJob. + * Format: + * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + * If this field is set, all of the search will be done in the context of + * this DataLabelingJob. + * @param {string} request.dataItemFilter + * An expression for filtering the DataItem that will be returned. + * + * * `data_item_id` - for = or !=. + * * `labeled` - for = or !=. + * * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that + * have at least one annotation with annotation_spec_id = + * `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. + * + * For example: + * + * * `data_item=1` + * * `has_annotation(5)` + * @param {string} request.annotationsFilter + * An expression for filtering the Annotations that will be returned per + * DataItem. + * * `annotation_spec_id` - for = or !=. + * @param {string[]} request.annotationFilters + * An expression that specifies what Annotations will be returned per + * DataItem. Annotations satisfied either of the conditions will be returned. + * * `annotation_spec_id` - for = or !=. + * Must specify `saved_query_id=` - saved query id that annotations should + * belong to. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields of + * {@link google.cloud.aiplatform.v1.DataItemView|DataItemView} to read. + * @param {number} request.annotationsLimit + * If set, only up to this many of Annotations will be returned per + * DataItemView. The maximum value is 1000. If not set, the maximum value will + * be used. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * Default and maximum page size is 100. + * @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 {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link google.cloud.aiplatform.v1.SearchDataItemsResponse.next_page_token|SearchDataItemsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1.DatasetService.SearchDataItems|DatasetService.SearchDataItems} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.aiplatform.v1.DataItemView | DataItemView}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see 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_SearchDataItems_async + */ + searchDataItemsAsync( + request?: protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, + 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({ + 'dataset': request.dataset ?? '', + }); + const defaultCallSettings = this._defaults['searchDataItems']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchDataItems.asyncIterate( + this.innerApiCalls['searchDataItems'] 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 {@link google.cloud.aiplatform.v1.SavedQuery | 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 {@link google.cloud.aiplatform.v1.SavedQuery | 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 + * {@link google.cloud.aiplatform.v1.SavedQuery | 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 {@link google.cloud.aiplatform.v1.Annotation | 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 {@link google.cloud.aiplatform.v1.Annotation | 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 + * {@link google.cloud.aiplatform.v1.Annotation | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + + /** + * 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/google-cloud-aiplatform/v1/src/v1/dataset_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/dataset_service_client_config.json new file mode 100644 index 00000000000..ac943c50a3e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/dataset_service_client_config.json @@ -0,0 +1,74 @@ +{ + "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" + }, + "SearchDataItems": { + "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/google-cloud-aiplatform/v1/src/v1/dataset_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/dataset_service_proto_list.json new file mode 100644 index 00000000000..b7295bb569f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/dataset_service_proto_list.json @@ -0,0 +1,115 @@ +[ + "../../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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/endpoint_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_client.ts new file mode 100644 index 00000000000..7bcbe61280f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_client.ts @@ -0,0 +1,3975 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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; + const mutateDeployedModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.MutateDeployedModelResponse') as gax.protobuf.Type; + const mutateDeployedModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata') 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)), + mutateDeployedModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + mutateDeployedModelResponse.decode.bind(mutateDeployedModelResponse), + mutateDeployedModelMetadata.decode.bind(mutateDeployedModelMetadata)) + }; + + // 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', 'mutateDeployedModel']; + 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 {@link google.cloud.aiplatform.v1.Endpoint | 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 {@link google.cloud.aiplatform.v1.Endpoint | 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. + * + * If the first character is a letter, this value may be up to 63 characters, + * and valid characters are `[a-z0-9-]`. The last character must be a letter + * or number. + * + * If the first character is a number, this value may be up to 9 characters, + * and valid characters are `[0-9]` with no leading zeros. + * + * 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; + } +/** + * Updates an existing deployed model. Updatable fields include + * `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, + * `disable_container_logging` (v1 only), and `enable_container_logging` + * (v1beta1 only). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.endpoint + * Required. The name of the Endpoint resource into which to mutate a + * DeployedModel. Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {google.cloud.aiplatform.v1.DeployedModel} request.deployedModel + * Required. The DeployedModel to be mutated within the Endpoint. Only the + * following fields can be mutated: + * + * * `min_replica_count` in either + * {@link google.cloud.aiplatform.v1.DedicatedResources|DedicatedResources} or + * {@link google.cloud.aiplatform.v1.AutomaticResources|AutomaticResources} + * * `max_replica_count` in either + * {@link google.cloud.aiplatform.v1.DedicatedResources|DedicatedResources} or + * {@link google.cloud.aiplatform.v1.AutomaticResources|AutomaticResources} + * * {@link google.cloud.aiplatform.v1.DedicatedResources.autoscaling_metric_specs|autoscaling_metric_specs} + * * `disable_container_logging` (v1 only) + * * `enable_container_logging` (v1beta1 only) + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://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_MutateDeployedModel_async + */ + mutateDeployedModel( + request?: protos.google.cloud.aiplatform.v1.IMutateDeployedModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + mutateDeployedModel( + request: protos.google.cloud.aiplatform.v1.IMutateDeployedModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + mutateDeployedModel( + request: protos.google.cloud.aiplatform.v1.IMutateDeployedModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + mutateDeployedModel( + request?: protos.google.cloud.aiplatform.v1.IMutateDeployedModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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.mutateDeployedModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `mutateDeployedModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://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_MutateDeployedModel_async + */ + async checkMutateDeployedModelProgress(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.mutateDeployedModel, 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 [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"` + * @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 {@link google.cloud.aiplatform.v1.Endpoint | 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 [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"` + * @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 {@link google.cloud.aiplatform.v1.Endpoint | 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 [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"` + * @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 + * {@link google.cloud.aiplatform.v1.Endpoint | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + + /** + * 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/google-cloud-aiplatform/v1/src/v1/endpoint_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_client_config.json new file mode 100644 index 00000000000..24f529b92ba --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_client_config.json @@ -0,0 +1,58 @@ +{ + "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" + }, + "MutateDeployedModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_proto_list.json new file mode 100644 index 00000000000..b7295bb569f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_proto_list.json @@ -0,0 +1,115 @@ +[ + "../../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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_client.ts new file mode 100644 index 00000000000..9817a8cc7e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_client.ts @@ -0,0 +1,2957 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, 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}; + 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}' + ), + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + 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') + }; + + // 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', '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.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 {@link google.cloud.aiplatform.v1.ReadFeatureValuesResponse | 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); + } +/** + * 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 {@link google.cloud.aiplatform.v1.WriteFeatureValuesResponse | 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_v1_generated_FeaturestoreOnlineServingService_WriteFeatureValues_async + */ + writeFeatureValues( + request?: protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IWriteFeatureValuesResponse, + protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest|undefined, {}|undefined + ]>; + writeFeatureValues( + request: protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IWriteFeatureValuesResponse, + protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest|null|undefined, + {}|null|undefined>): void; + writeFeatureValues( + request: protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IWriteFeatureValuesResponse, + protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest|null|undefined, + {}|null|undefined>): void; + writeFeatureValues( + request?: protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IWriteFeatureValuesResponse, + protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IWriteFeatureValuesResponse, + protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IWriteFeatureValuesResponse, + protos.google.cloud.aiplatform.v1.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.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 {@link google.cloud.aiplatform.v1.ReadFeatureValuesResponse | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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); + } + + // -------------------- + // -- 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 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + + /** + * 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(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_client_config.json new file mode 100644 index 00000000000..ca3c186f53d --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_client_config.json @@ -0,0 +1,38 @@ +{ + "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" + }, + "WriteFeatureValues": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_proto_list.json new file mode 100644 index 00000000000..b7295bb569f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_proto_list.json @@ -0,0 +1,115 @@ +[ + "../../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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/featurestore_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_client.ts new file mode 100644 index 00000000000..9f1a947c2cf --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_client.ts @@ -0,0 +1,6109 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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; + const deleteFeatureValuesResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteFeatureValuesResponse') as gax.protobuf.Type; + const deleteFeatureValuesMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteFeatureValuesOperationMetadata') 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)), + deleteFeatureValues: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteFeatureValuesResponse.decode.bind(deleteFeatureValuesResponse), + deleteFeatureValuesMetadata.decode.bind(deleteFeatureValuesMetadata)) + }; + + // 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', 'deleteFeatureValues', '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 {@link google.cloud.aiplatform.v1.Featurestore | 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 {@link google.cloud.aiplatform.v1.EntityType | 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` + * * `offline_storage_ttl_days` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.aiplatform.v1.EntityType | 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 {@link google.cloud.aiplatform.v1.Feature | 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 {@link google.cloud.aiplatform.v1.Feature | 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` + * * `online_storage_ttl_days` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://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 128 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. + * @param {google.protobuf.Timestamp} [request.startTime] + * Optional. 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://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; + } +/** + * Delete Feature values from Featurestore. + * + * The progress of the deletion is tracked by the returned operation. The + * deleted feature values are guaranteed to be invisible to subsequent read + * operations after the operation is marked as successfully done. + * + * If a delete feature values operation fails, the feature values + * returned from reads and exports may be inconsistent. If consistency is + * required, the caller must retry the same delete request again and wait till + * the new operation returned is marked as successfully done. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.DeleteFeatureValuesRequest.SelectEntity} request.selectEntity + * Select feature values to be deleted by specifying entities. + * @param {google.cloud.aiplatform.v1.DeleteFeatureValuesRequest.SelectTimeRangeAndFeature} request.selectTimeRangeAndFeature + * Select feature values to be deleted by specifying time range and + * features. + * @param {string} request.entityType + * Required. The resource name of the EntityType grouping the Features for + * which values are being deleted from. Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{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_DeleteFeatureValues_async + */ + deleteFeatureValues( + request?: protos.google.cloud.aiplatform.v1.IDeleteFeatureValuesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteFeatureValues( + request: protos.google.cloud.aiplatform.v1.IDeleteFeatureValuesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFeatureValues( + request: protos.google.cloud.aiplatform.v1.IDeleteFeatureValuesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFeatureValues( + request?: protos.google.cloud.aiplatform.v1.IDeleteFeatureValuesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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.deleteFeatureValues(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteFeatureValues()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://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_DeleteFeatureValues_async + */ + async checkDeleteFeatureValuesProgress(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.deleteFeatureValues, 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 {@link google.cloud.aiplatform.v1.Featurestore | 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 {@link google.cloud.aiplatform.v1.Featurestore | 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 + * {@link google.cloud.aiplatform.v1.Featurestore | 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 {@link google.cloud.aiplatform.v1.EntityType | 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 {@link google.cloud.aiplatform.v1.EntityType | 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 + * {@link google.cloud.aiplatform.v1.EntityType | 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 {@link google.cloud.aiplatform.v1.Feature | 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 {@link google.cloud.aiplatform.v1.Feature | 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 + * {@link google.cloud.aiplatform.v1.Feature | 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 {@link google.cloud.aiplatform.v1.Feature | 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 {@link google.cloud.aiplatform.v1.Feature | 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 + * {@link google.cloud.aiplatform.v1.Feature | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + + /** + * 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/google-cloud-aiplatform/v1/src/v1/featurestore_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_client_config.json new file mode 100644 index 00000000000..f1d667857a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_client_config.json @@ -0,0 +1,110 @@ +{ + "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" + }, + "DeleteFeatureValues": { + "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/google-cloud-aiplatform/v1/src/v1/featurestore_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_proto_list.json new file mode 100644 index 00000000000..b7295bb569f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_proto_list.json @@ -0,0 +1,115 @@ +[ + "../../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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..ead7be93841 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/gapic_metadata.json @@ -0,0 +1,2439 @@ +{ + "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" + ] + }, + "SearchDataItems": { + "methods": [ + "searchDataItems", + "searchDataItemsStream", + "searchDataItemsAsync" + ] + }, + "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" + ] + }, + "SearchDataItems": { + "methods": [ + "searchDataItems", + "searchDataItemsStream", + "searchDataItemsAsync" + ] + }, + "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" + ] + }, + "MutateDeployedModel": { + "methods": [ + "mutateDeployedModel" + ] + }, + "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" + ] + }, + "MutateDeployedModel": { + "methods": [ + "mutateDeployedModel" + ] + }, + "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" + ] + }, + "DeleteFeatureValues": { + "methods": [ + "deleteFeatureValues" + ] + }, + "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" + ] + }, + "DeleteFeatureValues": { + "methods": [ + "deleteFeatureValues" + ] + }, + "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" + ] + }, + "CreateNasJob": { + "methods": [ + "createNasJob" + ] + }, + "GetNasJob": { + "methods": [ + "getNasJob" + ] + }, + "CancelNasJob": { + "methods": [ + "cancelNasJob" + ] + }, + "GetNasTrialDetail": { + "methods": [ + "getNasTrialDetail" + ] + }, + "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" + ] + }, + "DeleteNasJob": { + "methods": [ + "deleteNasJob" + ] + }, + "DeleteBatchPredictionJob": { + "methods": [ + "deleteBatchPredictionJob" + ] + }, + "UpdateModelDeploymentMonitoringJob": { + "methods": [ + "updateModelDeploymentMonitoringJob" + ] + }, + "DeleteModelDeploymentMonitoringJob": { + "methods": [ + "deleteModelDeploymentMonitoringJob" + ] + }, + "ListCustomJobs": { + "methods": [ + "listCustomJobs", + "listCustomJobsStream", + "listCustomJobsAsync" + ] + }, + "ListDataLabelingJobs": { + "methods": [ + "listDataLabelingJobs", + "listDataLabelingJobsStream", + "listDataLabelingJobsAsync" + ] + }, + "ListHyperparameterTuningJobs": { + "methods": [ + "listHyperparameterTuningJobs", + "listHyperparameterTuningJobsStream", + "listHyperparameterTuningJobsAsync" + ] + }, + "ListNasJobs": { + "methods": [ + "listNasJobs", + "listNasJobsStream", + "listNasJobsAsync" + ] + }, + "ListNasTrialDetails": { + "methods": [ + "listNasTrialDetails", + "listNasTrialDetailsStream", + "listNasTrialDetailsAsync" + ] + }, + "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" + ] + }, + "CreateNasJob": { + "methods": [ + "createNasJob" + ] + }, + "GetNasJob": { + "methods": [ + "getNasJob" + ] + }, + "CancelNasJob": { + "methods": [ + "cancelNasJob" + ] + }, + "GetNasTrialDetail": { + "methods": [ + "getNasTrialDetail" + ] + }, + "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" + ] + }, + "DeleteNasJob": { + "methods": [ + "deleteNasJob" + ] + }, + "DeleteBatchPredictionJob": { + "methods": [ + "deleteBatchPredictionJob" + ] + }, + "UpdateModelDeploymentMonitoringJob": { + "methods": [ + "updateModelDeploymentMonitoringJob" + ] + }, + "DeleteModelDeploymentMonitoringJob": { + "methods": [ + "deleteModelDeploymentMonitoringJob" + ] + }, + "ListCustomJobs": { + "methods": [ + "listCustomJobs", + "listCustomJobsStream", + "listCustomJobsAsync" + ] + }, + "ListDataLabelingJobs": { + "methods": [ + "listDataLabelingJobs", + "listDataLabelingJobsStream", + "listDataLabelingJobsAsync" + ] + }, + "ListHyperparameterTuningJobs": { + "methods": [ + "listHyperparameterTuningJobs", + "listHyperparameterTuningJobsStream", + "listHyperparameterTuningJobsAsync" + ] + }, + "ListNasJobs": { + "methods": [ + "listNasJobs", + "listNasJobsStream", + "listNasJobsAsync" + ] + }, + "ListNasTrialDetails": { + "methods": [ + "listNasTrialDetails", + "listNasTrialDetailsStream", + "listNasTrialDetailsAsync" + ] + }, + "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" + ] + }, + "RemoveContextChildren": { + "methods": [ + "removeContextChildren" + ] + }, + "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" + ] + }, + "RemoveContextChildren": { + "methods": [ + "removeContextChildren" + ] + }, + "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" + ] + }, + "BatchImportEvaluatedAnnotations": { + "methods": [ + "batchImportEvaluatedAnnotations" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "GetModelEvaluationSlice": { + "methods": [ + "getModelEvaluationSlice" + ] + }, + "UploadModel": { + "methods": [ + "uploadModel" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "DeleteModelVersion": { + "methods": [ + "deleteModelVersion" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "CopyModel": { + "methods": [ + "copyModel" + ] + }, + "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" + ] + }, + "BatchImportEvaluatedAnnotations": { + "methods": [ + "batchImportEvaluatedAnnotations" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "GetModelEvaluationSlice": { + "methods": [ + "getModelEvaluationSlice" + ] + }, + "UploadModel": { + "methods": [ + "uploadModel" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "DeleteModelVersion": { + "methods": [ + "deleteModelVersion" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "CopyModel": { + "methods": [ + "copyModel" + ] + }, + "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" + ] + }, + "ReadTensorboardUsage": { + "methods": [ + "readTensorboardUsage" + ] + }, + "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" + ] + }, + "ReadTensorboardUsage": { + "methods": [ + "readTensorboardUsage" + ] + }, + "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/google-cloud-aiplatform/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index.ts new file mode 100644 index 00000000000..46e5062e243 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index.ts @@ -0,0 +1,33 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_client.ts new file mode 100644 index 00000000000..c46a62ad6d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_client.ts @@ -0,0 +1,3901 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1.IndexEndpoint | 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 {@link google.cloud.aiplatform.v1.IndexEndpoint | 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 {@link google.cloud.aiplatform.v1.IndexEndpoint | 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 {@link google.cloud.aiplatform.v1.IndexEndpoint | 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 + * {@link google.cloud.aiplatform.v1.IndexEndpoint | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + + /** + * 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/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_client_config.json new file mode 100644 index 00000000000..2a6743ffe88 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_proto_list.json new file mode 100644 index 00000000000..b7295bb569f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_proto_list.json @@ -0,0 +1,115 @@ +[ + "../../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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/index_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_service_client.ts new file mode 100644 index 00000000000..59c76d0b681 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_service_client.ts @@ -0,0 +1,3717 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1.Index | 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 {@link google.cloud.aiplatform.v1.UpsertDatapointsResponse | 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 {@link google.cloud.aiplatform.v1.RemoveDatapointsResponse | 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 {@link google.cloud.aiplatform.v1.Index | 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 {@link google.cloud.aiplatform.v1.Index | 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 + * {@link google.cloud.aiplatform.v1.Index | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + + /** + * 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/google-cloud-aiplatform/v1/src/v1/index_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_service_client_config.json new file mode 100644 index 00000000000..fb5e197f295 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/src/v1/index_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_service_proto_list.json new file mode 100644 index 00000000000..b7295bb569f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_service_proto_list.json @@ -0,0 +1,115 @@ +[ + "../../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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/job_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_client.ts new file mode 100644 index 00000000000..9aca88cce6f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_client.ts @@ -0,0 +1,7238 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + 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'), + listNasJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'nasJobs'), + listNasTrialDetails: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'nasTrialDetails'), + 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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 deleteNasJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteNasJobMetadata = 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)), + deleteNasJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteNasJobResponse.decode.bind(deleteNasJobResponse), + deleteNasJobMetadata.decode.bind(deleteNasJobMetadata)), + 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', 'createNasJob', 'getNasJob', 'listNasJobs', 'deleteNasJob', 'cancelNasJob', 'getNasTrialDetail', 'listNasTrialDetails', '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', + '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 -- + // ------------------- +/** + * 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 {@link google.cloud.aiplatform.v1.CustomJob | 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 {@link google.cloud.aiplatform.v1.CustomJob | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1.DataLabelingJob | 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 {@link google.cloud.aiplatform.v1.DataLabelingJob | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1.HyperparameterTuningJob | 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 {@link google.cloud.aiplatform.v1.HyperparameterTuningJob | 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 {@link google.protobuf.Empty | 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 NasJob + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the NasJob in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.NasJob} request.nasJob + * Required. The NasJob 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 {@link google.cloud.aiplatform.v1.NasJob | NasJob}. + * Please see the + * [documentation](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_CreateNasJob_async + */ + createNasJob( + request?: protos.google.cloud.aiplatform.v1.ICreateNasJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.INasJob, + protos.google.cloud.aiplatform.v1.ICreateNasJobRequest|undefined, {}|undefined + ]>; + createNasJob( + request: protos.google.cloud.aiplatform.v1.ICreateNasJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.INasJob, + protos.google.cloud.aiplatform.v1.ICreateNasJobRequest|null|undefined, + {}|null|undefined>): void; + createNasJob( + request: protos.google.cloud.aiplatform.v1.ICreateNasJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.INasJob, + protos.google.cloud.aiplatform.v1.ICreateNasJobRequest|null|undefined, + {}|null|undefined>): void; + createNasJob( + request?: protos.google.cloud.aiplatform.v1.ICreateNasJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.INasJob, + protos.google.cloud.aiplatform.v1.ICreateNasJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.INasJob, + protos.google.cloud.aiplatform.v1.ICreateNasJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.INasJob, + protos.google.cloud.aiplatform.v1.ICreateNasJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createNasJob(request, options, callback); + } +/** + * Gets a NasJob + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the NasJob resource. + * Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_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 {@link google.cloud.aiplatform.v1.NasJob | NasJob}. + * Please see the + * [documentation](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_GetNasJob_async + */ + getNasJob( + request?: protos.google.cloud.aiplatform.v1.IGetNasJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.INasJob, + protos.google.cloud.aiplatform.v1.IGetNasJobRequest|undefined, {}|undefined + ]>; + getNasJob( + request: protos.google.cloud.aiplatform.v1.IGetNasJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.INasJob, + protos.google.cloud.aiplatform.v1.IGetNasJobRequest|null|undefined, + {}|null|undefined>): void; + getNasJob( + request: protos.google.cloud.aiplatform.v1.IGetNasJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.INasJob, + protos.google.cloud.aiplatform.v1.IGetNasJobRequest|null|undefined, + {}|null|undefined>): void; + getNasJob( + request?: protos.google.cloud.aiplatform.v1.IGetNasJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.INasJob, + protos.google.cloud.aiplatform.v1.IGetNasJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.INasJob, + protos.google.cloud.aiplatform.v1.IGetNasJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.INasJob, + protos.google.cloud.aiplatform.v1.IGetNasJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getNasJob(request, options, callback); + } +/** + * Cancels a NasJob. + * Starts asynchronous cancellation on the NasJob. The server + * makes a best effort to cancel the job, but success is not + * guaranteed. Clients can use + * {@link google.cloud.aiplatform.v1.JobService.GetNasJob|JobService.GetNasJob} or + * other methods to check whether the cancellation succeeded or whether the + * job completed despite cancellation. On successful cancellation, + * the NasJob is not deleted; instead it becomes a job with + * a {@link google.cloud.aiplatform.v1.NasJob.error|NasJob.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.NasJob.state|NasJob.state} is set to + * `CANCELLED`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the NasJob to cancel. + * Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_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 {@link google.protobuf.Empty | 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_CancelNasJob_async + */ + cancelNasJob( + request?: protos.google.cloud.aiplatform.v1.ICancelNasJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelNasJobRequest|undefined, {}|undefined + ]>; + cancelNasJob( + request: protos.google.cloud.aiplatform.v1.ICancelNasJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelNasJobRequest|null|undefined, + {}|null|undefined>): void; + cancelNasJob( + request: protos.google.cloud.aiplatform.v1.ICancelNasJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelNasJobRequest|null|undefined, + {}|null|undefined>): void; + cancelNasJob( + request?: protos.google.cloud.aiplatform.v1.ICancelNasJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelNasJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelNasJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelNasJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.cancelNasJob(request, options, callback); + } +/** + * Gets a NasTrialDetail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the NasTrialDetail resource. + * Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.aiplatform.v1.NasTrialDetail | NasTrialDetail}. + * Please see the + * [documentation](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_GetNasTrialDetail_async + */ + getNasTrialDetail( + request?: protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.INasTrialDetail, + protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest|undefined, {}|undefined + ]>; + getNasTrialDetail( + request: protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.INasTrialDetail, + protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest|null|undefined, + {}|null|undefined>): void; + getNasTrialDetail( + request: protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.INasTrialDetail, + protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest|null|undefined, + {}|null|undefined>): void; + getNasTrialDetail( + request?: protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.INasTrialDetail, + protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.INasTrialDetail, + protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.INasTrialDetail, + protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getNasTrialDetail(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 {@link google.cloud.aiplatform.v1.BatchPredictionJob | 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 {@link google.cloud.aiplatform.v1.BatchPredictionJob | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob | 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 {@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob | 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 {@link google.protobuf.Empty | 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 {@link google.protobuf.Empty | 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 NasJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the NasJob resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_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_DeleteNasJob_async + */ + deleteNasJob( + request?: protos.google.cloud.aiplatform.v1.IDeleteNasJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteNasJob( + request: protos.google.cloud.aiplatform.v1.IDeleteNasJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteNasJob( + request: protos.google.cloud.aiplatform.v1.IDeleteNasJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteNasJob( + request?: protos.google.cloud.aiplatform.v1.IDeleteNasJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteNasJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteNasJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://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_DeleteNasJob_async + */ + async checkDeleteNasJobProgress(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.deleteNasJob, 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1.CustomJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1.CustomJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 + * {@link google.cloud.aiplatform.v1.CustomJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1.DataLabelingJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1.DataLabelingJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 + * {@link google.cloud.aiplatform.v1.DataLabelingJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1.HyperparameterTuningJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1.HyperparameterTuningJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 + * {@link google.cloud.aiplatform.v1.HyperparameterTuningJob | 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 NasJobs 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 NasJobs + * 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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.ListNasJobsResponse.next_page_token|ListNasJobsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1.JobService.ListNasJobs|JobService.ListNasJobs} + * 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 {@link google.cloud.aiplatform.v1.NasJob | NasJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listNasJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listNasJobs( + request?: protos.google.cloud.aiplatform.v1.IListNasJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.INasJob[], + protos.google.cloud.aiplatform.v1.IListNasJobsRequest|null, + protos.google.cloud.aiplatform.v1.IListNasJobsResponse + ]>; + listNasJobs( + request: protos.google.cloud.aiplatform.v1.IListNasJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListNasJobsRequest, + protos.google.cloud.aiplatform.v1.IListNasJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.INasJob>): void; + listNasJobs( + request: protos.google.cloud.aiplatform.v1.IListNasJobsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListNasJobsRequest, + protos.google.cloud.aiplatform.v1.IListNasJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.INasJob>): void; + listNasJobs( + request?: protos.google.cloud.aiplatform.v1.IListNasJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListNasJobsRequest, + protos.google.cloud.aiplatform.v1.IListNasJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.INasJob>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListNasJobsRequest, + protos.google.cloud.aiplatform.v1.IListNasJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.INasJob>): + Promise<[ + protos.google.cloud.aiplatform.v1.INasJob[], + protos.google.cloud.aiplatform.v1.IListNasJobsRequest|null, + protos.google.cloud.aiplatform.v1.IListNasJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listNasJobs(request, options, callback); + } + +/** + * Equivalent to `method.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 NasJobs + * 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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.ListNasJobsResponse.next_page_token|ListNasJobsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1.JobService.ListNasJobs|JobService.ListNasJobs} + * 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 {@link google.cloud.aiplatform.v1.NasJob | NasJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listNasJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listNasJobsStream( + request?: protos.google.cloud.aiplatform.v1.IListNasJobsRequest, + 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['listNasJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNasJobs.createStream( + this.innerApiCalls.listNasJobs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listNasJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with 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 NasJobs + * 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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.ListNasJobsResponse.next_page_token|ListNasJobsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1.JobService.ListNasJobs|JobService.ListNasJobs} + * 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 + * {@link google.cloud.aiplatform.v1.NasJob | NasJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see 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_ListNasJobs_async + */ + listNasJobsAsync( + request?: protos.google.cloud.aiplatform.v1.IListNasJobsRequest, + 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['listNasJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNasJobs.asyncIterate( + this.innerApiCalls['listNasJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List top NasTrialDetails of a NasJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the NasJob resource. + * Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @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.ListNasTrialDetailsResponse.next_page_token|ListNasTrialDetailsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1.JobService.ListNasTrialDetails|JobService.ListNasTrialDetails} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.aiplatform.v1.NasTrialDetail | NasTrialDetail}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listNasTrialDetailsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listNasTrialDetails( + request?: protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.INasTrialDetail[], + protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest|null, + protos.google.cloud.aiplatform.v1.IListNasTrialDetailsResponse + ]>; + listNasTrialDetails( + request: protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, + protos.google.cloud.aiplatform.v1.IListNasTrialDetailsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.INasTrialDetail>): void; + listNasTrialDetails( + request: protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, + protos.google.cloud.aiplatform.v1.IListNasTrialDetailsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.INasTrialDetail>): void; + listNasTrialDetails( + request?: protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, + protos.google.cloud.aiplatform.v1.IListNasTrialDetailsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.INasTrialDetail>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, + protos.google.cloud.aiplatform.v1.IListNasTrialDetailsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.INasTrialDetail>): + Promise<[ + protos.google.cloud.aiplatform.v1.INasTrialDetail[], + protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest|null, + protos.google.cloud.aiplatform.v1.IListNasTrialDetailsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listNasTrialDetails(request, options, callback); + } + +/** + * Equivalent to `method.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 NasJob resource. + * Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @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.ListNasTrialDetailsResponse.next_page_token|ListNasTrialDetailsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1.JobService.ListNasTrialDetails|JobService.ListNasTrialDetails} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.aiplatform.v1.NasTrialDetail | NasTrialDetail} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listNasTrialDetailsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listNasTrialDetailsStream( + request?: protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, + 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['listNasTrialDetails']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNasTrialDetails.createStream( + this.innerApiCalls.listNasTrialDetails as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listNasTrialDetails`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with 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 NasJob resource. + * Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @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.ListNasTrialDetailsResponse.next_page_token|ListNasTrialDetailsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1.JobService.ListNasTrialDetails|JobService.ListNasTrialDetails} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.aiplatform.v1.NasTrialDetail | NasTrialDetail}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see 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_ListNasTrialDetails_async + */ + listNasTrialDetailsAsync( + request?: protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, + 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['listNasTrialDetails']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNasTrialDetails.asyncIterate( + this.innerApiCalls['listNasTrialDetails'] 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1.BatchPredictionJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1.BatchPredictionJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 + * {@link google.cloud.aiplatform.v1.BatchPredictionJob | 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 {@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies | 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 {@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies | 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 + * {@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 + * {@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + + /** + * 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/google-cloud-aiplatform/v1/src/v1/job_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_client_config.json new file mode 100644 index 00000000000..32e7535ad87 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_client_config.json @@ -0,0 +1,166 @@ +{ + "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" + }, + "CreateNasJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetNasJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListNasJobs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteNasJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelNasJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetNasTrialDetail": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListNasTrialDetails": { + "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/google-cloud-aiplatform/v1/src/v1/job_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_proto_list.json new file mode 100644 index 00000000000..b7295bb569f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_proto_list.json @@ -0,0 +1,115 @@ +[ + "../../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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/metadata_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_client.ts new file mode 100644 index 00000000000..1797b757107 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_client.ts @@ -0,0 +1,6749 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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', 'removeContextChildren', '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 {@link google.cloud.aiplatform.v1.MetadataStore | 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 {@link google.cloud.aiplatform.v1.Artifact | 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 {@link google.cloud.aiplatform.v1.Artifact | 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 {@link google.cloud.aiplatform.v1.Artifact | 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 {@link google.cloud.aiplatform.v1.Context | 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 {@link google.cloud.aiplatform.v1.Context | 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 {@link google.cloud.aiplatform.v1.Context | 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 {@link google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsResponse | 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 {@link google.cloud.aiplatform.v1.AddContextChildrenResponse | 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); + } +/** + * Remove a set of children contexts from a parent Context. If any of the + * child Contexts were NOT added to the parent 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 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 {@link google.cloud.aiplatform.v1.RemoveContextChildrenResponse | RemoveContextChildrenResponse}. + * Please see the + * [documentation](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_RemoveContextChildren_async + */ + removeContextChildren( + request?: protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IRemoveContextChildrenResponse, + protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest|undefined, {}|undefined + ]>; + removeContextChildren( + request: protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IRemoveContextChildrenResponse, + protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest|null|undefined, + {}|null|undefined>): void; + removeContextChildren( + request: protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IRemoveContextChildrenResponse, + protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest|null|undefined, + {}|null|undefined>): void; + removeContextChildren( + request?: protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IRemoveContextChildrenResponse, + protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IRemoveContextChildrenResponse, + protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IRemoveContextChildrenResponse, + protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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.removeContextChildren(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 {@link google.cloud.aiplatform.v1.LineageSubgraph | 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 {@link google.cloud.aiplatform.v1.Execution | 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 {@link google.cloud.aiplatform.v1.Execution | 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 {@link google.cloud.aiplatform.v1.Execution | 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 {@link google.cloud.aiplatform.v1.AddExecutionEventsResponse | 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 {@link google.cloud.aiplatform.v1.LineageSubgraph | 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 {@link google.cloud.aiplatform.v1.MetadataSchema | 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 {@link google.cloud.aiplatform.v1.MetadataSchema | 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`). Maximum nested expression depth allowed + * is 5. + * + * 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 {@link google.cloud.aiplatform.v1.LineageSubgraph | 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 {@link google.cloud.aiplatform.v1.MetadataStore | 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 {@link google.cloud.aiplatform.v1.MetadataStore | 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 + * {@link google.cloud.aiplatform.v1.MetadataStore | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.aiplatform.v1.Artifact | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.aiplatform.v1.Artifact | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.aiplatform.v1.Artifact | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.aiplatform.v1.Context | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.aiplatform.v1.Context | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.aiplatform.v1.Context | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.aiplatform.v1.Execution | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.aiplatform.v1.Execution | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.aiplatform.v1.Execution | 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 {@link google.cloud.aiplatform.v1.MetadataSchema | 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 {@link google.cloud.aiplatform.v1.MetadataSchema | 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 + * {@link google.cloud.aiplatform.v1.MetadataSchema | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + + /** + * 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/google-cloud-aiplatform/v1/src/v1/metadata_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_client_config.json new file mode 100644 index 00000000000..3c69196d680 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_client_config.json @@ -0,0 +1,154 @@ +{ + "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" + }, + "RemoveContextChildren": { + "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/google-cloud-aiplatform/v1/src/v1/metadata_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_proto_list.json new file mode 100644 index 00000000000..b7295bb569f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_proto_list.json @@ -0,0 +1,115 @@ +[ + "../../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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/migration_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/migration_service_client.ts new file mode 100644 index 00000000000..735f226331f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/migration_service_client.ts @@ -0,0 +1,3314 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1.MigratableResource | 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 {@link google.cloud.aiplatform.v1.MigratableResource | 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 + * {@link google.cloud.aiplatform.v1.MigratableResource | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + + /** + * 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/google-cloud-aiplatform/v1/src/v1/migration_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/migration_service_client_config.json new file mode 100644 index 00000000000..59e4d9aa96f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/src/v1/migration_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/migration_service_proto_list.json new file mode 100644 index 00000000000..b7295bb569f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/migration_service_proto_list.json @@ -0,0 +1,115 @@ +[ + "../../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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/model_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_client.ts new file mode 100644 index 00000000000..53a5b599414 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_client.ts @@ -0,0 +1,5134 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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; + const copyModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.CopyModelResponse') as gax.protobuf.Type; + const copyModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.CopyModelOperationMetadata') 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)), + copyModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + copyModelResponse.decode.bind(copyModelResponse), + copyModelMetadata.decode.bind(copyModelMetadata)) + }; + + // 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', 'copyModel', 'importModelEvaluation', 'batchImportModelEvaluationSlices', 'batchImportEvaluatedAnnotations', '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 {@link google.cloud.aiplatform.v1.Model | 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 {@link google.cloud.aiplatform.v1.Model | 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 {@link google.cloud.aiplatform.v1.Model | 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 {@link google.cloud.aiplatform.v1.ModelEvaluation | 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 {@link google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse | 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); + } +/** + * Imports a list of externally generated EvaluatedAnnotations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent ModelEvaluationSlice resource. + * Format: + * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` + * @param {number[]} request.evaluatedAnnotations + * Required. Evaluated annotations 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 {@link google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsResponse | BatchImportEvaluatedAnnotationsResponse}. + * Please see the + * [documentation](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_BatchImportEvaluatedAnnotations_async + */ + batchImportEvaluatedAnnotations( + request?: protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, + protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest|undefined, {}|undefined + ]>; + batchImportEvaluatedAnnotations( + request: protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, + protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest|null|undefined, + {}|null|undefined>): void; + batchImportEvaluatedAnnotations( + request: protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, + protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest|null|undefined, + {}|null|undefined>): void; + batchImportEvaluatedAnnotations( + request?: protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, + protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, + protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, + protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchImportEvaluatedAnnotations(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 {@link google.cloud.aiplatform.v1.ModelEvaluation | 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 {@link google.cloud.aiplatform.v1.ModelEvaluationSlice | 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 {string} [request.serviceAccount] + * Optional. The user-provided custom service account to use to do the model + * upload. If empty, [Vertex AI Service + * Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) + * will be used. Users uploading the Model must have the + * `iam.serviceAccounts.actAs` permission on this service account. Also, this + * account must belong to the project specified in the `parent` field and have + * all necessary read permissions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://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 google.cloud.aiplatform.v1.DeployedModel|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 + * [supported export + * format][google.cloud.aiplatform.v1.Model.supported_export_formats]. + * + * @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; + } +/** + * Copies an already existing Vertex AI Model into the specified Location. + * The source Model must exist in the same Project. + * When copying custom Models, the users themselves are responsible for + * {@link google.cloud.aiplatform.v1.Model.metadata|Model.metadata} content to be + * region-agnostic, as well as making sure that any resources (e.g. files) it + * depends on remain accessible. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.modelId] + * Optional. Copy source_model into a new Model with this ID. The ID 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 {string} [request.parentModel] + * Optional. Specify this field to copy source_model into this existing + * Model as a new version. Format: + * `projects/{project}/locations/{location}/models/{model}` + * @param {string} request.parent + * Required. The resource name of the Location into which to copy the Model. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.sourceModel + * Required. The resource name of the Model to copy. That Model must be in the + * same Project. Format: + * `projects/{project}/locations/{location}/models/{model}` + * @param {google.cloud.aiplatform.v1.EncryptionSpec} request.encryptionSpec + * Customer-managed encryption key options. If this is set, + * then the Model copy will be encrypted with the provided encryption key. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://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_CopyModel_async + */ + copyModel( + request?: protos.google.cloud.aiplatform.v1.ICopyModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + copyModel( + request: protos.google.cloud.aiplatform.v1.ICopyModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + copyModel( + request: protos.google.cloud.aiplatform.v1.ICopyModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + copyModel( + request?: protos.google.cloud.aiplatform.v1.ICopyModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.copyModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `copyModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://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_CopyModel_async + */ + async checkCopyModelProgress(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.copyModel, 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 [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"` + * @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 {@link google.cloud.aiplatform.v1.Model | 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 [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"` + * @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 {@link google.cloud.aiplatform.v1.Model | 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 [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"` + * @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 + * {@link google.cloud.aiplatform.v1.Model | 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|next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1.ModelService.ListModelVersions|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 {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` + * + * Example: `update_time asc, 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 {@link google.cloud.aiplatform.v1.Model | 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|next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1.ModelService.ListModelVersions|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 {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` + * + * Example: `update_time asc, 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 {@link google.cloud.aiplatform.v1.Model | 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|next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1.ModelService.ListModelVersions|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 {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` + * + * Example: `update_time asc, 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 + * {@link google.cloud.aiplatform.v1.Model | 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 {@link google.cloud.aiplatform.v1.ModelEvaluation | 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 {@link google.cloud.aiplatform.v1.ModelEvaluation | 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 + * {@link google.cloud.aiplatform.v1.ModelEvaluation | 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 {@link google.cloud.aiplatform.v1.ModelEvaluationSlice | 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 {@link google.cloud.aiplatform.v1.ModelEvaluationSlice | 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 + * {@link google.cloud.aiplatform.v1.ModelEvaluationSlice | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + + /** + * 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/google-cloud-aiplatform/v1/src/v1/model_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_client_config.json new file mode 100644 index 00000000000..705668228c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_client_config.json @@ -0,0 +1,94 @@ +{ + "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" + }, + "CopyModel": { + "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" + }, + "BatchImportEvaluatedAnnotations": { + "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/google-cloud-aiplatform/v1/src/v1/model_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_proto_list.json new file mode 100644 index 00000000000..b7295bb569f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_proto_list.json @@ -0,0 +1,115 @@ +[ + "../../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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/pipeline_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/pipeline_service_client.ts new file mode 100644 index 00000000000..5365d505c6a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/pipeline_service_client.ts @@ -0,0 +1,4265 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1.TrainingPipeline | 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 {@link google.cloud.aiplatform.v1.TrainingPipeline | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1.PipelineJob | 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 {@link google.cloud.aiplatform.v1.PipelineJob | 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 {@link google.protobuf.Empty | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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 {@link google.cloud.aiplatform.v1.TrainingPipeline | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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 {@link google.cloud.aiplatform.v1.TrainingPipeline | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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 + * {@link google.cloud.aiplatform.v1.TrainingPipeline | 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 {@link google.cloud.aiplatform.v1.PipelineJob | 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 {@link google.cloud.aiplatform.v1.PipelineJob | 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 + * {@link google.cloud.aiplatform.v1.PipelineJob | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + + /** + * 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/google-cloud-aiplatform/v1/src/v1/pipeline_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/pipeline_service_client_config.json new file mode 100644 index 00000000000..0c4df9123a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/src/v1/pipeline_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/pipeline_service_proto_list.json new file mode 100644 index 00000000000..b7295bb569f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/pipeline_service_proto_list.json @@ -0,0 +1,115 @@ +[ + "../../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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/prediction_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_client.ts new file mode 100644 index 00000000000..0ea57034d80 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_client.ts @@ -0,0 +1,3030 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, 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}; + 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}' + ), + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + 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}' + ), + }; + + // 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' [Model's + * ][google.cloud.aiplatform.v1.DeployedModel.model] + * {@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 {@link google.cloud.aiplatform.v1.PredictResponse | 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 {@link google.api.HttpBody | 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' [Model's + * ][google.cloud.aiplatform.v1.DeployedModel.model] + * {@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 {@link google.cloud.aiplatform.v1.ExplainResponse | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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); + } + + // -------------------- + // -- 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 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + + /** + * 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(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_client_config.json new file mode 100644 index 00000000000..e043161e514 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/src/v1/prediction_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_proto_list.json new file mode 100644 index 00000000000..b7295bb569f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_proto_list.json @@ -0,0 +1,115 @@ +[ + "../../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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_client.ts new file mode 100644 index 00000000000..faa253d576b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_client.ts @@ -0,0 +1,3564 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1.SpecialistPool | 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 {@link google.cloud.aiplatform.v1.SpecialistPool | 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 {@link google.cloud.aiplatform.v1.SpecialistPool | 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 + * {@link google.cloud.aiplatform.v1.SpecialistPool | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + + /** + * 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/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_client_config.json new file mode 100644 index 00000000000..a80b72c2db9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_proto_list.json new file mode 100644 index 00000000000..b7295bb569f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_proto_list.json @@ -0,0 +1,115 @@ +[ + "../../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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/tensorboard_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_client.ts new file mode 100644 index 00000000000..475f626ed58 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_client.ts @@ -0,0 +1,6135 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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', 'readTensorboardUsage', '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 {@link google.cloud.aiplatform.v1.Tensorboard | 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); + } +/** + * Returns a list of monthly active users for a given TensorBoard instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tensorboard + * 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 {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse | ReadTensorboardUsageResponse}. + * Please see the + * [documentation](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_ReadTensorboardUsage_async + */ + readTensorboardUsage( + request?: protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IReadTensorboardUsageResponse, + protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest|undefined, {}|undefined + ]>; + readTensorboardUsage( + request: protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IReadTensorboardUsageResponse, + protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest|null|undefined, + {}|null|undefined>): void; + readTensorboardUsage( + request: protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IReadTensorboardUsageResponse, + protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest|null|undefined, + {}|null|undefined>): void; + readTensorboardUsage( + request?: protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IReadTensorboardUsageResponse, + protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IReadTensorboardUsageResponse, + protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IReadTensorboardUsageResponse, + protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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.readTensorboardUsage(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 becomes 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 {@link google.cloud.aiplatform.v1.TensorboardExperiment | 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 {@link google.cloud.aiplatform.v1.TensorboardExperiment | 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 is overwritten if it's in the mask. If the + * user does not provide a mask then all fields are 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 {@link google.cloud.aiplatform.v1.TensorboardExperiment | 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 becomes 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 {@link google.cloud.aiplatform.v1.TensorboardRun | 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 {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse | 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 {@link google.cloud.aiplatform.v1.TensorboardRun | 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 is overwritten if it's in the mask. If the + * user does not provide a mask then all fields are 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 {@link google.cloud.aiplatform.v1.TensorboardRun | 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 {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse | 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 becomes 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 {@link google.cloud.aiplatform.v1.TensorboardTimeSeries | 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 {@link google.cloud.aiplatform.v1.TensorboardTimeSeries | 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 is overwritten if it's in the mask. If the + * user does not provide a mask then all fields are 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 {@link google.cloud.aiplatform.v1.TensorboardTimeSeries | 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 is returned. + * Otherwise, the number limit of data points is 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 {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse | 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 is returned. Otherwise, 1000 + * data points is 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 {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse | 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 is 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 {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse | 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 is 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 {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse | 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 {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse | 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 is overwritten if it's in the mask. If the + * user does not provide a mask then all fields are 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 are + * returned. The maximum value is 100; values above 100 are 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 {@link google.cloud.aiplatform.v1.Tensorboard | 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 are + * returned. The maximum value is 100; values above 100 are 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 {@link google.cloud.aiplatform.v1.Tensorboard | 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 are + * returned. The maximum value is 100; values above 100 are 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 + * {@link google.cloud.aiplatform.v1.Tensorboard | 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 are returned. The maximum value is 1000; values + * above 1000 are 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 {@link google.cloud.aiplatform.v1.TensorboardExperiment | 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 are returned. The maximum value is 1000; values + * above 1000 are 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 {@link google.cloud.aiplatform.v1.TensorboardExperiment | 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 are returned. The maximum value is 1000; values + * above 1000 are 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 + * {@link google.cloud.aiplatform.v1.TensorboardExperiment | 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 are + * returned. The maximum value is 1000; values above 1000 are 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 {@link google.cloud.aiplatform.v1.TensorboardRun | 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 are + * returned. The maximum value is 1000; values above 1000 are 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 {@link google.cloud.aiplatform.v1.TensorboardRun | 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 are + * returned. The maximum value is 1000; values above 1000 are 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 + * {@link google.cloud.aiplatform.v1.TensorboardRun | 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 are returned. The maximum value is 1000; values + * above 1000 are 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 {@link google.cloud.aiplatform.v1.TensorboardTimeSeries | 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 are returned. The maximum value is 1000; values + * above 1000 are 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 {@link google.cloud.aiplatform.v1.TensorboardTimeSeries | 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 are returned. The maximum value is 1000; values + * above 1000 are 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 + * {@link google.cloud.aiplatform.v1.TensorboardTimeSeries | 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 is 1000. Values must be between 1 and 10000. + * Values above 10000 are coerced to 10000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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 is 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 {@link google.cloud.aiplatform.v1.TimeSeriesDataPoint | 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 is 1000. Values must be between 1 and 10000. + * Values above 10000 are coerced to 10000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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 is 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 {@link google.cloud.aiplatform.v1.TimeSeriesDataPoint | 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 is 1000. Values must be between 1 and 10000. + * Values above 10000 are coerced to 10000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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 is 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 + * {@link google.cloud.aiplatform.v1.TimeSeriesDataPoint | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + + /** + * 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/google-cloud-aiplatform/v1/src/v1/tensorboard_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_client_config.json new file mode 100644 index 00000000000..649e11414ce --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_client_config.json @@ -0,0 +1,142 @@ +{ + "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" + }, + "ReadTensorboardUsage": { + "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/google-cloud-aiplatform/v1/src/v1/tensorboard_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_proto_list.json new file mode 100644 index 00000000000..b7295bb569f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_proto_list.json @@ -0,0 +1,115 @@ +[ + "../../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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/vizier_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/vizier_service_client.ts new file mode 100644 index 00000000000..5f2f4829e92 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/vizier_service_client.ts @@ -0,0 +1,4388 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1.Study | 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 {@link google.cloud.aiplatform.v1.Study | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1.Study | 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 {@link google.cloud.aiplatform.v1.Trial | 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 {@link google.cloud.aiplatform.v1.Trial | 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 {@link google.cloud.aiplatform.v1.Trial | 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 {@link google.cloud.aiplatform.v1.Trial | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1.Trial | 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 {@link google.cloud.aiplatform.v1.ListOptimalTrialsResponse | 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.aiplatform.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 {@link google.cloud.aiplatform.v1.Study | 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 {@link google.cloud.aiplatform.v1.Study | 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 + * {@link google.cloud.aiplatform.v1.Study | 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 {@link google.cloud.aiplatform.v1.Trial | 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 {@link google.cloud.aiplatform.v1.Trial | 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 + * {@link google.cloud.aiplatform.v1.Trial | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + + /** + * 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/google-cloud-aiplatform/v1/src/v1/vizier_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/vizier_service_client_config.json new file mode 100644 index 00000000000..fe86ba2bb2a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/src/v1/vizier_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/vizier_service_proto_list.json new file mode 100644 index 00000000000..b7295bb569f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/vizier_service_proto_list.json @@ -0,0 +1,115 @@ +[ + "../../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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-aiplatform/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..969ccee3f6a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,41 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/google-cloud-aiplatform/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-aiplatform/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..cfd68b24fde --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,116 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/google-cloud-aiplatform/v1/system-test/install.ts b/owl-bot-staging/google-cloud-aiplatform/v1/system-test/install.ts new file mode 100644 index 00000000000..c8f81b25a86 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/google-cloud-aiplatform/v1/test/gapic_dataset_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_dataset_service_v1.ts new file mode 100644 index 00000000000..a810cb7a6f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_dataset_service_v1.ts @@ -0,0 +1,4968 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('searchDataItems', () => { + it('invokes searchDataItems 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.SearchDataItemsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.SearchDataItemsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), + ]; + client.innerApiCalls.searchDataItems = stubSimpleCall(expectedResponse); + const [response] = await client.searchDataItems(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchDataItems as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchDataItems as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchDataItems 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.SearchDataItemsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.SearchDataItemsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), + ]; + client.innerApiCalls.searchDataItems = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchDataItems( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IDataItemView[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchDataItems as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchDataItems as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchDataItems 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.SearchDataItemsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.SearchDataItemsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchDataItems = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchDataItems(request), expectedError); + const actualRequest = (client.innerApiCalls.searchDataItems as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchDataItems as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchDataItemsStream 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.SearchDataItemsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.SearchDataItemsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), + ]; + client.descriptors.page.searchDataItems.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchDataItemsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.DataItemView[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.DataItemView) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.searchDataItems.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchDataItems, request)); + assert( + (client.descriptors.page.searchDataItems.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchDataItemsStream 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.SearchDataItemsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.SearchDataItemsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchDataItems.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchDataItemsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.DataItemView[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.DataItemView) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchDataItems.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchDataItems, request)); + assert( + (client.descriptors.page.searchDataItems.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchDataItems 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.SearchDataItemsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.SearchDataItemsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), + ]; + client.descriptors.page.searchDataItems.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IDataItemView[] = []; + const iterable = client.searchDataItemsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchDataItems.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchDataItems.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchDataItems 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.SearchDataItemsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.SearchDataItemsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchDataItems.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchDataItemsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IDataItemView[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchDataItems.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchDataItems.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_endpoint_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_endpoint_service_v1.ts new file mode 100644 index 00000000000..6e1b47257cf --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_endpoint_service_v1.ts @@ -0,0 +1,4034 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('mutateDeployedModel', () => { + it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.MutateDeployedModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.mutateDeployedModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.mutateDeployedModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.mutateDeployedModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.MutateDeployedModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.mutateDeployedModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.mutateDeployedModel( + request, + (err?: Error|null, + result?: 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.mutateDeployedModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.MutateDeployedModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateDeployedModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.mutateDeployedModel(request), expectedError); + const actualRequest = (client.innerApiCalls.mutateDeployedModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.MutateDeployedModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateDeployedModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.mutateDeployedModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.mutateDeployedModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkMutateDeployedModelProgress 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.checkMutateDeployedModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkMutateDeployedModelProgress 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.checkMutateDeployedModelProgress(''), 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_featurestore_online_serving_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_featurestore_online_serving_service_v1.ts new file mode 100644 index 00000000000..621797fb4c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_featurestore_online_serving_service_v1.ts @@ -0,0 +1,2790 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.WriteFeatureValuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.WriteFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.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.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.WriteFeatureValuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.WriteFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.WriteFeatureValuesResponse() + ); + client.innerApiCalls.writeFeatureValues = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.writeFeatureValues( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.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.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.WriteFeatureValuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.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.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.WriteFeatureValuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.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.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_featurestore_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_featurestore_service_v1.ts new file mode 100644 index 00000000000..f518bacdf49 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_featurestore_service_v1.ts @@ -0,0 +1,6209 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('deleteFeatureValues', () => { + it('invokes deleteFeatureValues 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.DeleteFeatureValuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.DeleteFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteFeatureValues = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteFeatureValues(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFeatureValues 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.DeleteFeatureValuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.DeleteFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteFeatureValues = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFeatureValues( + request, + (err?: Error|null, + result?: 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.deleteFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFeatureValues 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.DeleteFeatureValuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.DeleteFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeatureValues = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteFeatureValues(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFeatureValues 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.DeleteFeatureValuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.DeleteFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteFeatureValues(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteFeatureValuesProgress 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.checkDeleteFeatureValuesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteFeatureValuesProgress 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.checkDeleteFeatureValuesProgress(''), 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_index_endpoint_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_index_endpoint_service_v1.ts new file mode 100644 index 00000000000..fe9b05c622b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_index_endpoint_service_v1.ts @@ -0,0 +1,4034 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_index_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_index_service_v1.ts new file mode 100644 index 00000000000..61b90aead63 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_index_service_v1.ts @@ -0,0 +1,3834 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_job_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_job_service_v1.ts new file mode 100644 index 00000000000..c3a6f5521dd --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_job_service_v1.ts @@ -0,0 +1,8001 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('createNasJob', () => { + it('invokes createNasJob 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.CreateNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.CreateNasJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.NasJob() + ); + client.innerApiCalls.createNasJob = stubSimpleCall(expectedResponse); + const [response] = await client.createNasJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNasJob 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.CreateNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.CreateNasJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.NasJob() + ); + client.innerApiCalls.createNasJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createNasJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.INasJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNasJob 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.CreateNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.CreateNasJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNasJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createNasJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNasJob 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.CreateNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.CreateNasJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createNasJob(request), expectedError); + }); + }); + + describe('getNasJob', () => { + it('invokes getNasJob 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.GetNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.GetNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.NasJob() + ); + client.innerApiCalls.getNasJob = stubSimpleCall(expectedResponse); + const [response] = await client.getNasJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNasJob 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.GetNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.GetNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.NasJob() + ); + client.innerApiCalls.getNasJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getNasJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.INasJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNasJob 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.GetNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.GetNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNasJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getNasJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNasJob 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.GetNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.GetNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getNasJob(request), expectedError); + }); + }); + + describe('cancelNasJob', () => { + it('invokes cancelNasJob 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.CancelNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.CancelNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelNasJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelNasJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelNasJob 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.CancelNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.CancelNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelNasJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelNasJob( + 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.cancelNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelNasJob 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.CancelNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.CancelNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelNasJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelNasJob(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelNasJob 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.CancelNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.CancelNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelNasJob(request), expectedError); + }); + }); + + describe('getNasTrialDetail', () => { + it('invokes getNasTrialDetail 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.GetNasTrialDetailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.GetNasTrialDetailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.NasTrialDetail() + ); + client.innerApiCalls.getNasTrialDetail = stubSimpleCall(expectedResponse); + const [response] = await client.getNasTrialDetail(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNasTrialDetail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNasTrialDetail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNasTrialDetail 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.GetNasTrialDetailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.GetNasTrialDetailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.NasTrialDetail() + ); + client.innerApiCalls.getNasTrialDetail = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getNasTrialDetail( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.INasTrialDetail|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNasTrialDetail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNasTrialDetail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNasTrialDetail 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.GetNasTrialDetailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.GetNasTrialDetailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNasTrialDetail = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getNasTrialDetail(request), expectedError); + const actualRequest = (client.innerApiCalls.getNasTrialDetail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNasTrialDetail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNasTrialDetail 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.GetNasTrialDetailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.GetNasTrialDetailRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getNasTrialDetail(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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('deleteNasJob', () => { + it('invokes deleteNasJob 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.DeleteNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.DeleteNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteNasJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteNasJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNasJob 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.DeleteNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.DeleteNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteNasJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteNasJob( + request, + (err?: Error|null, + result?: 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.deleteNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNasJob 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.DeleteNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.DeleteNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNasJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteNasJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNasJob 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.DeleteNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.DeleteNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNasJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteNasJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteNasJobProgress 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.checkDeleteNasJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteNasJobProgress 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.checkDeleteNasJobProgress(''), 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('listNasJobs', () => { + it('invokes listNasJobs 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.ListNasJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), + ]; + client.innerApiCalls.listNasJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listNasJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listNasJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNasJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNasJobs 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.ListNasJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), + ]; + client.innerApiCalls.listNasJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNasJobs( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.INasJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listNasJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNasJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNasJobs 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.ListNasJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listNasJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listNasJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listNasJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNasJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNasJobsStream 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.ListNasJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), + ]; + client.descriptors.page.listNasJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listNasJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.NasJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.NasJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listNasJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listNasJobs, request)); + assert( + (client.descriptors.page.listNasJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listNasJobsStream 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.ListNasJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNasJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listNasJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.NasJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.NasJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listNasJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listNasJobs, request)); + assert( + (client.descriptors.page.listNasJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNasJobs 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.ListNasJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), + ]; + client.descriptors.page.listNasJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.INasJob[] = []; + const iterable = client.listNasJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listNasJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listNasJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNasJobs 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.ListNasJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNasJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listNasJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.INasJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listNasJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listNasJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listNasTrialDetails', () => { + it('invokes listNasTrialDetails 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.ListNasTrialDetailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasTrialDetailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), + ]; + client.innerApiCalls.listNasTrialDetails = stubSimpleCall(expectedResponse); + const [response] = await client.listNasTrialDetails(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listNasTrialDetails as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNasTrialDetails as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNasTrialDetails 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.ListNasTrialDetailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasTrialDetailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), + ]; + client.innerApiCalls.listNasTrialDetails = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNasTrialDetails( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.INasTrialDetail[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listNasTrialDetails as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNasTrialDetails as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNasTrialDetails 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.ListNasTrialDetailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasTrialDetailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listNasTrialDetails = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listNasTrialDetails(request), expectedError); + const actualRequest = (client.innerApiCalls.listNasTrialDetails as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNasTrialDetails as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNasTrialDetailsStream 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.ListNasTrialDetailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasTrialDetailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), + ]; + client.descriptors.page.listNasTrialDetails.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listNasTrialDetailsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.NasTrialDetail[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.NasTrialDetail) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listNasTrialDetails.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listNasTrialDetails, request)); + assert( + (client.descriptors.page.listNasTrialDetails.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listNasTrialDetailsStream 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.ListNasTrialDetailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasTrialDetailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNasTrialDetails.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listNasTrialDetailsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.NasTrialDetail[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.NasTrialDetail) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listNasTrialDetails.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listNasTrialDetails, request)); + assert( + (client.descriptors.page.listNasTrialDetails.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNasTrialDetails 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.ListNasTrialDetailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasTrialDetailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), + ]; + client.descriptors.page.listNasTrialDetails.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.INasTrialDetail[] = []; + const iterable = client.listNasTrialDetailsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listNasTrialDetails.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listNasTrialDetails.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNasTrialDetails 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.ListNasTrialDetailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasTrialDetailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNasTrialDetails.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listNasTrialDetailsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.INasTrialDetail[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listNasTrialDetails.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listNasTrialDetails.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_metadata_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_metadata_service_v1.ts new file mode 100644 index 00000000000..766030ed96e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_metadata_service_v1.ts @@ -0,0 +1,7350 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('removeContextChildren', () => { + it('invokes removeContextChildren 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.RemoveContextChildrenRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.RemoveContextChildrenRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RemoveContextChildrenResponse() + ); + client.innerApiCalls.removeContextChildren = stubSimpleCall(expectedResponse); + const [response] = await client.removeContextChildren(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.removeContextChildren as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.removeContextChildren as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeContextChildren 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.RemoveContextChildrenRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.RemoveContextChildrenRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RemoveContextChildrenResponse() + ); + client.innerApiCalls.removeContextChildren = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeContextChildren( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IRemoveContextChildrenResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.removeContextChildren as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.removeContextChildren as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeContextChildren 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.RemoveContextChildrenRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.RemoveContextChildrenRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.removeContextChildren = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.removeContextChildren(request), expectedError); + const actualRequest = (client.innerApiCalls.removeContextChildren as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.removeContextChildren as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeContextChildren 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.RemoveContextChildrenRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.RemoveContextChildrenRequest', ['context']); + request.context = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.removeContextChildren(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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_migration_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_migration_service_v1.ts new file mode 100644 index 00000000000..8dda9321d5a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_migration_service_v1.ts @@ -0,0 +1,3198 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_model_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_model_service_v1.ts new file mode 100644 index 00000000000..fd3ad9b2563 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_model_service_v1.ts @@ -0,0 +1,5417 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('batchImportEvaluatedAnnotations', () => { + it('invokes batchImportEvaluatedAnnotations 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.BatchImportEvaluatedAnnotationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsResponse() + ); + client.innerApiCalls.batchImportEvaluatedAnnotations = stubSimpleCall(expectedResponse); + const [response] = await client.batchImportEvaluatedAnnotations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchImportEvaluatedAnnotations 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.BatchImportEvaluatedAnnotationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsResponse() + ); + client.innerApiCalls.batchImportEvaluatedAnnotations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchImportEvaluatedAnnotations( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchImportEvaluatedAnnotations 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.BatchImportEvaluatedAnnotationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchImportEvaluatedAnnotations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchImportEvaluatedAnnotations(request), expectedError); + const actualRequest = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchImportEvaluatedAnnotations 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.BatchImportEvaluatedAnnotationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchImportEvaluatedAnnotations(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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('copyModel', () => { + it('invokes copyModel 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.CopyModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.CopyModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.copyModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.copyModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.copyModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.copyModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes copyModel 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.CopyModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.CopyModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.copyModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.copyModel( + request, + (err?: Error|null, + result?: 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.copyModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.copyModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes copyModel 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.CopyModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.CopyModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.copyModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.copyModel(request), expectedError); + const actualRequest = (client.innerApiCalls.copyModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.copyModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes copyModel 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.CopyModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.CopyModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.copyModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.copyModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.copyModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.copyModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCopyModelProgress 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.checkCopyModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCopyModelProgress 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.checkCopyModelProgress(''), 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_pipeline_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_pipeline_service_v1.ts new file mode 100644 index 00000000000..2e9306fedbb --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_pipeline_service_v1.ts @@ -0,0 +1,4245 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_prediction_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_prediction_service_v1.ts new file mode 100644 index 00000000000..7d792547802 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_prediction_service_v1.ts @@ -0,0 +1,2787 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_specialist_pool_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_specialist_pool_service_v1.ts new file mode 100644 index 00000000000..d22adf84ab2 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_specialist_pool_service_v1.ts @@ -0,0 +1,3618 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_tensorboard_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_tensorboard_service_v1.ts new file mode 100644 index 00000000000..a07d0093dea --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_tensorboard_service_v1.ts @@ -0,0 +1,6939 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('readTensorboardUsage', () => { + it('invokes readTensorboardUsage 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.ReadTensorboardUsageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ReadTensorboardUsageRequest', ['tensorboard']); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse() + ); + client.innerApiCalls.readTensorboardUsage = stubSimpleCall(expectedResponse); + const [response] = await client.readTensorboardUsage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.readTensorboardUsage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardUsage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readTensorboardUsage 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.ReadTensorboardUsageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ReadTensorboardUsageRequest', ['tensorboard']); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse() + ); + client.innerApiCalls.readTensorboardUsage = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.readTensorboardUsage( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IReadTensorboardUsageResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.readTensorboardUsage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardUsage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readTensorboardUsage 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.ReadTensorboardUsageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ReadTensorboardUsageRequest', ['tensorboard']); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.readTensorboardUsage = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.readTensorboardUsage(request), expectedError); + const actualRequest = (client.innerApiCalls.readTensorboardUsage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardUsage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readTensorboardUsage 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.ReadTensorboardUsageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1.ReadTensorboardUsageRequest', ['tensorboard']); + request.tensorboard = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.readTensorboardUsage(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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_vizier_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_vizier_service_v1.ts new file mode 100644 index 00000000000..d0c663f4009 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_vizier_service_v1.ts @@ -0,0 +1,4785 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/tsconfig.json b/owl-bot-staging/google-cloud-aiplatform/v1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/webpack.config.js b/owl-bot-staging/google-cloud-aiplatform/v1/webpack.config.js new file mode 100644 index 00000000000..f4947d41e6b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/.eslintignore b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/.eslintrc.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/.gitignore b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/.jsdoc.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.jsdoc.js new file mode 100644 index 00000000000..c805f17d6a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/aiplatform', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/.mocharc.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.mocharc.js new file mode 100644 index 00000000000..1a38f257db7 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/google-cloud-aiplatform/v1beta1/.prettierrc.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.prettierrc.js new file mode 100644 index 00000000000..55639e70f9e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/google-cloud-aiplatform/v1beta1/README.md b/owl-bot-staging/google-cloud-aiplatform/v1beta1/README.md new file mode 100644 index 00000000000..7f057918e1b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/README.md @@ -0,0 +1 @@ +Aiplatform: Nodejs Client diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/linkinator.config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/package.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/package.json new file mode 100644 index 00000000000..fef6d91d1e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/package.json @@ -0,0 +1,81 @@ +{ + "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", + "match service", + "metadata service", + "migration service", + "model service", + "pipeline service", + "prediction service", + "schedule 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.7" + }, + "devDependencies": { + "@types/mocha": "^10.0.1", + "@types/node": "^18.11.18", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.1", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.1", + "jsdoc-region-tag": "^2.0.1", + "linkinator": "^4.1.2", + "mocha": "^10.2.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.1", + "ts-loader": "^8.4.0", + "typescript": "^4.8.4", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto new file mode 100644 index 00000000000..92c9b50f345 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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; + + // Nvidia A2 Ultra GPU. + NVIDIA_A100_80GB = 9; + + // TPU v2. + TPU_V2 = 6; + + // TPU v3. + TPU_V3 = 7; + + // TPU v4. + TPU_V4_POD = 10; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation.proto new file mode 100644 index 00000000000..a7e494bf10e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation.proto @@ -0,0 +1,96 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto new file mode 100644 index 00000000000..3a25408c438 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto @@ -0,0 +1,57 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/artifact.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/artifact.proto new file mode 100644 index 00000000000..445dfe85b55 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/artifact.proto @@ -0,0 +1,112 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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. + // Top level metadata keys' heading and trailing spaces will be trimmed. + // 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto new file mode 100644 index 00000000000..5a98131589b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto @@ -0,0 +1,472 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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]; + } + + // Configuration defining how to transform batch prediction input instances to + // the instances that the Model accepts. + message InstanceConfig { + // The format of the instance that the Model accepts. Vertex AI will + // convert compatible + // [batch prediction input instance + // formats][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.instances_format] + // to the specified format. + // + // Supported values are: + // + // * `object`: Each input is converted to JSON object format. + // * For `bigquery`, each row is converted to an object. + // * For `jsonl`, each line of the JSONL input must be an object. + // * Does not apply to `csv`, `file-list`, `tf-record`, or + // `tf-record-gzip`. + // + // * `array`: Each input is converted to JSON array format. + // * For `bigquery`, each row is converted to an array. The order + // of columns is determined by the BigQuery column order, unless + // [included_fields][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.included_fields] + // is populated. + // [included_fields][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.included_fields] + // must be populated for specifying field orders. + // * For `jsonl`, if each line of the JSONL input is an object, + // [included_fields][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.included_fields] + // must be populated for specifying field orders. + // * Does not apply to `csv`, `file-list`, `tf-record`, or + // `tf-record-gzip`. + // + // If not specified, Vertex AI converts the batch prediction input as + // follows: + // + // * For `bigquery` and `csv`, the behavior is the same as `array`. The + // order of columns is the same as defined in the file or table, unless + // [included_fields][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.included_fields] + // is populated. + // * For `jsonl`, the prediction instance format is determined by + // each line of the input. + // * For `tf-record`/`tf-record-gzip`, each record will be converted to + // an object in the format of `{"b64": }`, where `` is + // the Base64-encoded string of the content of the record. + // * For `file-list`, each file in the list will be converted to an + // object in the format of `{"b64": }`, where `` is + // the Base64-encoded string of the content of the file. + string instance_type = 1; + + // The name of the field that is considered as a key. + // + // The values identified by the key field is not included in the transformed + // instances that is sent to the Model. This is similar to + // specifying this name of the field in + // [excluded_fields][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.excluded_fields]. + // In addition, the batch prediction output will not include the instances. + // Instead the output will only include the value of the key field, in a + // field named `key` in the output: + // + // * For `jsonl` output format, the output will have a `key` field + // instead of the `instance` field. + // * For `csv`/`bigquery` output format, the output will have have a `key` + // column instead of the instance feature columns. + // + // The input must be JSONL with objects at each line, CSV, BigQuery + // or TfRecord. + string key_field = 2; + + // Fields that will be included in the prediction instance that is + // sent to the Model. + // + // If + // [instance_type][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.instance_type] + // is `array`, the order of field names in included_fields also determines + // the order of the values in the array. + // + // When included_fields is populated, + // [excluded_fields][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.excluded_fields] + // must be empty. + // + // The input must be JSONL with objects at each line, CSV, BigQuery + // or TfRecord. + repeated string included_fields = 3; + + // Fields that will be excluded in the prediction instance that is + // sent to the Model. + // + // Excluded will be attached to the batch prediction output if + // [key_field][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.key_field] + // is not specified. + // + // When excluded_fields is populated, + // [included_fields][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.included_fields] + // must be empty. + // + // The input must be JSONL with objects at each line, CSV, BigQuery + // or TfRecord. + repeated string excluded_fields = 4; + } + + // 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 resource 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. + // Example: `projects/{project}/locations/{location}/models/{model}@2` + // or + // `projects/{project}/locations/{location}/models/{model}@golden` + // if no version is specified, the default version will be deployed. + 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]; + + // Configuration for how to convert batch prediction input instances to the + // prediction instances that are sent to the Model. + InstanceConfig instance_config = 27; + + // 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 Google Cloud 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 Google Cloud 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]; + + // 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 = 34; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto new file mode 100644 index 00000000000..e97245e307a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto @@ -0,0 +1,50 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/context.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/context.proto new file mode 100644 index 00000000000..bcfcd3e8987 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/context.proto @@ -0,0 +1,97 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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. + // Top level metadata keys' heading and trailing spaces will be trimmed. + // 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto new file mode 100644 index 00000000000..dc41de428b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto @@ -0,0 +1,301 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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 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. +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]; + + // Optional. Whether you want Vertex AI to enable access to the customized + // dashboard in training chief container. + // + // If set to `true`, you can access the dashboard 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_dashboard_access = 16 [(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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_item.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_item.proto new file mode 100644 index 00000000000..93e389938e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_item.proto @@ -0,0 +1,74 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto new file mode 100644 index 00000000000..42b597f31bf --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto @@ -0,0 +1,210 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto new file mode 100644 index 00000000000..1ae48018638 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto @@ -0,0 +1,202 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/saved_query.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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 consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the Dataset. + string description = 16; + + // 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; + + // All SavedQueries belong to the Dataset will be returned in List/Get + // Dataset response. The [annotation_specs][SavedQuery.annotation_specs] field + // will not be populated except for UI cases which will only use + // [annotation_spec_count][google.cloud.aiplatform.v1beta1.SavedQuery.annotation_spec_count]. + // In CreateDataset request, a SavedQuery is created together if + // this field is set, up to one SavedQuery can be set in CreateDatasetRequest. + // The SavedQuery should not contain any AnnotationSpec. + repeated SavedQuery saved_queries = 9; + + // 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; + + // Output only. The resource name of the Artifact that was created in + // MetadataStore when creating the Dataset. The Artifact resource name pattern + // is + // `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`. + string metadata_artifact = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// 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; + + // Labels that will be applied to newly imported Annotations. If two + // Annotations are identical, one of them will be deduped. Two Annotations are + // considered identical if their + // [payload][google.cloud.aiplatform.v1beta1.Annotation.payload], + // [payload_schema_uri][google.cloud.aiplatform.v1beta1.Annotation.payload_schema_uri] + // and all of their + // [labels][google.cloud.aiplatform.v1beta1.Annotation.labels] are the same. + // 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 annotation_labels = 3; + + // 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; + } + + // The instructions how the export data should be split between the + // training, validation and test sets. + oneof split { + // Split based on fractions defining the size of each set. + ExportFractionSplit fraction_split = 5; + } + + // 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; +} + +// Assigns the input data to training, validation, and test sets as per the +// given fractions. Any of `training_fraction`, `validation_fraction` and +// `test_fraction` may optionally be provided, they must sum to up to 1. If the +// provided ones sum to less than 1, the remainder is assigned to sets as +// decided by Vertex AI. If none of the fractions are set, by default roughly +// 80% of data is used for training, 10% for validation, and 10% for test. +message ExportFractionSplit { + // The fraction of the input data that is to be used to train the Model. + double training_fraction = 1; + + // The fraction of the input data that is to be used to validate the Model. + double validation_fraction = 2; + + // The fraction of the input data that is to be used to evaluate the Model. + double test_fraction = 3; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto new file mode 100644 index 00000000000..b1377b27593 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto @@ -0,0 +1,631 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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"; + } + + // Searches DataItems in a Dataset. + rpc SearchDataItems(SearchDataItemsRequest) + returns (SearchDataItemsResponse) { + option (google.api.http) = { + get: "/v1beta1/{dataset=projects/*/locations/*/datasets/*}:searchDataItems" + }; + } + + // 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.SearchDataItems][google.cloud.aiplatform.v1beta1.DatasetService.SearchDataItems]. +message SearchDataItemsRequest { + // Expression that allows ranking results based on annotation's property. + message OrderByAnnotation { + // Required. Saved query of the Annotation. Only Annotations belong to this + // saved query will be considered for ordering. + string saved_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // A comma-separated list of annotation fields to order by, sorted in + // ascending order. Use "desc" after a field name for descending. Must also + // specify saved_query. + string order_by = 2; + } + + oneof order { + // A comma-separated list of data item fields to order by, sorted in + // ascending order. Use "desc" after a field name for descending. + string order_by_data_item = 12; + + // Expression that allows ranking results based on annotation's property. + OrderByAnnotation order_by_annotation = 13; + } + + // Required. The resource name of the Dataset from which to search DataItems. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}` + string dataset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + } + ]; + + // The resource name of a SavedQuery(annotation set in UI). + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` + // All of the search will be done in the context of this SavedQuery. + string saved_query = 2 [ + deprecated = true, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/SavedQuery" + } + ]; + + // The resource name of a DataLabelingJob. + // Format: + // `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + // If this field is set, all of the search will be done in the context of + // this DataLabelingJob. + string data_labeling_job = 3; + + // An expression for filtering the DataItem that will be returned. + // + // * `data_item_id` - for = or !=. + // * `labeled` - for = or !=. + // * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that + // have at least one annotation with annotation_spec_id = + // `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. + // + // For example: + // + // * `data_item=1` + // * `has_annotation(5)` + string data_item_filter = 4; + + // An expression for filtering the Annotations that will be returned per + // DataItem. + // * `annotation_spec_id` - for = or !=. + string annotations_filter = 5 [deprecated = true]; + + // An expression that specifies what Annotations will be returned per + // DataItem. Annotations satisfied either of the conditions will be returned. + // * `annotation_spec_id` - for = or !=. + // Must specify `saved_query_id=` - saved query id that annotations should + // belong to. + repeated string annotation_filters = 11; + + // Mask specifying which fields of + // [DataItemView][google.cloud.aiplatform.v1beta1.DataItemView] to read. + google.protobuf.FieldMask field_mask = 6; + + // If set, only up to this many of Annotations will be returned per + // DataItemView. The maximum value is 1000. If not set, the maximum value will + // be used. + int32 annotations_limit = 7; + + // Requested page size. Server may return fewer results than requested. + // Default and maximum page size is 100. + int32 page_size = 8; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + string order_by = 9 [deprecated = true]; + + // A token identifying a page of results for the server to return + // Typically obtained via + // [SearchDataItemsResponse.next_page_token][google.cloud.aiplatform.v1beta1.SearchDataItemsResponse.next_page_token] + // of the previous + // [DatasetService.SearchDataItems][google.cloud.aiplatform.v1beta1.DatasetService.SearchDataItems] + // call. + string page_token = 10; +} + +// Response message for +// [DatasetService.SearchDataItems][google.cloud.aiplatform.v1beta1.DatasetService.SearchDataItems]. +message SearchDataItemsResponse { + // The DataItemViews read. + repeated DataItemView data_item_views = 1; + + // A token to retrieve next page of results. + // Pass to + // [SearchDataItemsRequest.page_token][google.cloud.aiplatform.v1beta1.SearchDataItemsRequest.page_token] + // to obtain that page. + string next_page_token = 2; +} + +// A container for a single DataItem and Annotations on it. +message DataItemView { + // The DataItem. + DataItem data_item = 1; + + // The Annotations on the DataItem. If too many Annotations should be returned + // for the DataItem, this field will be truncated per annotations_limit in + // request. If it was, then the has_truncated_annotations will be set to true. + repeated Annotation annotations = 2; + + // True if and only if the Annotations field has been truncated. It happens if + // more Annotations for this DataItem met the request's annotation_filter than + // are allowed to be returned by annotations_limit. + // Note that if Annotations field is not being returned due to field mask, + // then this field will not be set to true no matter how many Annotations are + // there. + bool has_truncated_annotations = 3; +} + +// 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto new file mode 100644 index 00000000000..b9659a4dee7 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto @@ -0,0 +1,42 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto new file mode 100644 index 00000000000..68fc304ba68 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto @@ -0,0 +1,42 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto new file mode 100644 index 00000000000..bb450ca452b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto @@ -0,0 +1,53 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto new file mode 100644 index 00000000000..63b3c4386d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto @@ -0,0 +1,236 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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; + + // The total number of DeployedModels on this DeploymentResourcePool. + int32 total_deployed_model_count = 4; + + // The total number of Endpoints that have DeployedModels on this + // DeploymentResourcePool. + int32 total_endpoint_count = 5; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto new file mode 100644 index 00000000000..47788c22202 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto @@ -0,0 +1,38 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto new file mode 100644 index 00000000000..6d1c9aef19d --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto @@ -0,0 +1,298 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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 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; + + // Optional. 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.field_behavior) = OPTIONAL, + (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]. + // Required except for Large Model Deploy use cases. + 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. + // Example: `projects/{project}/locations/{location}/models/{model}@2` + // or + // `projects/{project}/locations/{location}/models/{model}@golden` + // 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; + + // If true, deploy the model without explainable feature, regardless the + // existence of + // [Model.explanation_spec][google.cloud.aiplatform.v1beta1.Model.explanation_spec] + // or + // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec]. + bool disable_explanations = 19; + + // 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; + + // If true, online prediction access logs are sent to StackDriver + // Logging. + // 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto new file mode 100644 index 00000000000..fdf008eb827 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto @@ -0,0 +1,350 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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. + // + // If the first character is a letter, this value may be up to 63 characters, + // and valid characters are `[a-z0-9-]`. The last character must be a letter + // or number. + // + // If the first character is a number, this value may be up to 9 characters, + // and valid characters are `[0-9]` with no leading zeros. + // + // 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/entity_type.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/entity_type.proto new file mode 100644 index 00000000000..40070774212 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/entity_type.proto @@ -0,0 +1,98 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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]; + + // Optional. Config for data retention policy in offline storage. + // TTL in days for feature values that will be stored in offline storage. + // The Feature Store offline storage periodically removes obsolete feature + // values older than `offline_storage_ttl_days` since the feature generation + // time. If unset (or explicitly set to 0), default to 4000 days TTL. + int32 offline_storage_ttl_days = 10 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/env_var.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/env_var.proto new file mode 100644 index 00000000000..aa61f4a2d5a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/env_var.proto @@ -0,0 +1,42 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto new file mode 100644 index 00000000000..6e68912c0f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto @@ -0,0 +1,185 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "EvaluatedAnnotationProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// True positive, false positive, or false negative. +// +// EvaluatedAnnotation is only available under ModelEvaluationSlice with slice +// of `annotationSpec` dimension. +message EvaluatedAnnotation { + // Describes the type of the EvaluatedAnnotation. The type is determined + enum EvaluatedAnnotationType { + // Invalid value. + EVALUATED_ANNOTATION_TYPE_UNSPECIFIED = 0; + + // The EvaluatedAnnotation is a true positive. It has a prediction created + // by the Model and a ground truth Annotation which the prediction matches. + TRUE_POSITIVE = 1; + + // The EvaluatedAnnotation is false positive. It has a prediction created by + // the Model which does not match any ground truth annotation. + FALSE_POSITIVE = 2; + + // The EvaluatedAnnotation is false negative. It has a ground truth + // annotation which is not matched by any of the model created predictions. + FALSE_NEGATIVE = 3; + } + + // Output only. Type of the EvaluatedAnnotation. + EvaluatedAnnotationType type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The model predicted annotations. + // + // For true positive, there is one and only one prediction, which matches the + // only one ground truth annotation in + // [ground_truths][google.cloud.aiplatform.v1beta1.EvaluatedAnnotation.ground_truths]. + // + // For false positive, there is one and only one prediction, which doesn't + // match any ground truth annotation of the corresponding + // [data_item_view_id][EvaluatedAnnotation.data_item_view_id]. + // + // For false negative, there are zero or more predictions which are similar to + // the only ground truth annotation in + // [ground_truths][google.cloud.aiplatform.v1beta1.EvaluatedAnnotation.ground_truths] + // but not enough for a match. + // + // The schema of the prediction is stored in + // [ModelEvaluation.annotation_schema_uri][] + repeated google.protobuf.Value predictions = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The ground truth Annotations, i.e. the Annotations that exist + // in the test data the Model is evaluated on. + // + // For true positive, there is one and only one ground truth annotation, which + // matches the only prediction in + // [predictions][google.cloud.aiplatform.v1beta1.EvaluatedAnnotation.predictions]. + // + // For false positive, there are zero or more ground truth annotations that + // are similar to the only prediction in + // [predictions][google.cloud.aiplatform.v1beta1.EvaluatedAnnotation.predictions], + // but not enough for a match. + // + // For false negative, there is one and only one ground truth annotation, + // which doesn't match any predictions created by the model. + // + // The schema of the ground truth is stored in + // [ModelEvaluation.annotation_schema_uri][] + repeated google.protobuf.Value ground_truths = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The data item payload that the Model predicted this + // EvaluatedAnnotation on. + google.protobuf.Value data_item_payload = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. ID of the EvaluatedDataItemView under the same ancestor + // ModelEvaluation. The EvaluatedDataItemView consists of all ground truths + // and predictions on + // [data_item_payload][google.cloud.aiplatform.v1beta1.EvaluatedAnnotation.data_item_payload]. + // + // Can be passed in + // [GetEvaluatedDataItemView's][ModelService.GetEvaluatedDataItemView][] + // [id][GetEvaluatedDataItemViewRequest.id]. + string evaluated_data_item_view_id = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Explanations of + // [predictions][google.cloud.aiplatform.v1beta1.EvaluatedAnnotation.predictions]. + // Each element of the explanations indicates the explanation for one + // explanation Method. + // + // The attributions list in the + // [EvaluatedAnnotationExplanation.explanation][google.cloud.aiplatform.v1beta1.EvaluatedAnnotationExplanation.explanation] + // object corresponds to the + // [predictions][google.cloud.aiplatform.v1beta1.EvaluatedAnnotation.predictions] + // list. For example, the second element in the attributions list explains the + // second element in the predictions list. + repeated EvaluatedAnnotationExplanation explanations = 8; + + // Annotations of model error analysis results. + repeated ErrorAnalysisAnnotation error_analysis_annotations = 9; +} + +// Explanation result of the prediction produced by the Model. +message EvaluatedAnnotationExplanation { + // Explanation type. + // + // For AutoML Image Classification models, possible values are: + // + // * `image-integrated-gradients` + // * `image-xrai` + string explanation_type = 1; + + // Explanation attribution response details. + Explanation explanation = 2; +} + +// Model error analysis for each annotation. +message ErrorAnalysisAnnotation { + // Attributed items for a given annotation, typically representing neighbors + // from the training sets constrained by the query type. + message AttributedItem { + // The unique ID for each annotation. Used by FE to allocate the annotation + // in DB. + string annotation_resource_name = 1; + + // The distance of this item to the annotation. + double distance = 2; + } + + // The query type used for finding the attributed items. + enum QueryType { + // Unspecified query type for model error analysis. + QUERY_TYPE_UNSPECIFIED = 0; + + // Query similar samples across all classes in the dataset. + ALL_SIMILAR = 1; + + // Query similar samples from the same class of the input sample. + SAME_CLASS_SIMILAR = 2; + + // Query dissimilar samples from the same class of the input sample. + SAME_CLASS_DISSIMILAR = 3; + } + + // Attributed items for a given annotation, typically representing neighbors + // from the training sets constrained by the query type. + repeated AttributedItem attributed_items = 1; + + // The query type used for finding the attributed items. + QueryType query_type = 2; + + // The outlier score of this annotated item. Usually defined as the min of all + // distances from attributed items. + double outlier_score = 3; + + // The threshold used to determine if this annotation is an outlier or not. + double outlier_threshold = 4; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/event.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/event.proto new file mode 100644 index 00000000000..22a229fa440 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/event.proto @@ -0,0 +1,81 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/execution.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/execution.proto new file mode 100644 index 00000000000..da68119786c --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/execution.proto @@ -0,0 +1,118 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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. + // Top level metadata keys' heading and trailing spaces will be trimmed. + // 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto new file mode 100644 index 00000000000..29ee96a7b94 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto @@ -0,0 +1,564 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto new file mode 100644 index 00000000000..25ba8a41739 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto @@ -0,0 +1,424 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto new file mode 100644 index 00000000000..4ac111e5f72 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto @@ -0,0 +1,185 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto new file mode 100644 index 00000000000..f1caf42c9bb --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto @@ -0,0 +1,87 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_selector.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_selector.proto new file mode 100644 index 00000000000..a44e9f0249d --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_selector.proto @@ -0,0 +1,44 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore.proto new file mode 100644 index 00000000000..b935b273666 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore.proto @@ -0,0 +1,152 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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; + + // Optional. The cpu utilization that the Autoscaler should be trying to + // achieve. This number is on a scale from 0 (no utilization) to 100 + // (total utilization), and is limited between 10 and 80. When a cluster's + // CPU utilization exceeds the target that you have set, Bigtable + // immediately adds nodes to the cluster. When CPU utilization is + // substantially lower than the target, Bigtable removes nodes. If not set + // or set to 0, default to 50. + int32 cpu_utilization_target = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // 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. The field should not + // co-exist with the field of `OnlineStoreReplicationConfig`. If both of it + // and OnlineStoreReplicationConfig are unset, the feature store 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. TTL in days for feature values that will be stored in online + // serving storage. The Feature Store online storage periodically removes + // obsolete feature values older than `online_storage_ttl_days` since the + // feature generation time. Note that `online_storage_ttl_days` should be less + // than or equal to `offline_storage_ttl_days` for each EntityType under a + // featurestore. If not set, default to 4000 days + int32 online_storage_ttl_days = 13 [(google.api.field_behavior) = OPTIONAL]; + + // 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto new file mode 100644 index 00000000000..134f109416d --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto @@ -0,0 +1,163 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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. + // If both + // [monitoring_interval_days][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days] + // and the deprecated `monitoring_interval` field + // are set when creating/updating EntityTypes/Features, + // [monitoring_interval_days][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days] + // will be used. + google.protobuf.Duration monitoring_interval = 2 [deprecated = true]; + + // Configuration of the snapshot analysis based monitoring pipeline + // running interval. The value indicates number of days. + 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][google.cloud.aiplatform.v1beta1.FeaturestoreService.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][google.cloud.aiplatform.v1beta1.FeaturestoreService.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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto new file mode 100644 index 00000000000..af6182b2d56 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto @@ -0,0 +1,285 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto new file mode 100644 index 00000000000..5efd213643f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto @@ -0,0 +1,1444 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/interval.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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" + }; + } + + // Delete Feature values from Featurestore. + // + // The progress of the deletion is tracked by the returned operation. The + // deleted feature values are guaranteed to be invisible to subsequent read + // operations after the operation is marked as successfully done. + // + // If a delete feature values operation fails, the feature values + // returned from reads and exports may be inconsistent. If consistency is + // required, the caller must retry the same delete request again and wait till + // the new operation returned is marked as successfully done. + rpc DeleteFeatureValues(DeleteFeatureValuesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:deleteFeatureValues" + body: "*" + }; + option (google.api.method_signature) = "entity_type"; + option (google.longrunning.operation_info) = { + response_type: "DeleteFeatureValuesResponse" + metadata_type: "DeleteFeatureValuesOperationMetadata" + }; + } + + // 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` + // * `online_storage_ttl_days` (available in Preview) + 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; + + // The number rows that weren't ingested due to having feature timestamps + // outside the retention boundary. + int64 timestamp_outside_retention_rows_count = 4; +} + +// 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. + repeated EntityTypeSpec entity_type_specs = 7 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. 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 = 11 + [(google.api.field_behavior) = OPTIONAL]; +} + +// 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` + // * `offline_storage_ttl_days` (available in Preview) + 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 128 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 source URI from where Feature values are imported. + repeated string source_uris = 4; + + // 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; + + // The number rows that weren't ingested due to having timestamps outside the + // retention boundary. + int64 timestamp_outside_retention_rows_count = 7; +} + +// 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 delete Feature values. +message DeleteFeatureValuesOperationMetadata { + // Operation metadata for Featurestore delete 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; +} + +// Request message for +// [FeaturestoreService.DeleteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.DeleteFeatureValues]. +message DeleteFeatureValuesRequest { + // Message to select entity. + // If an entity id is selected, all the feature values corresponding to the + // entity id will be deleted, including the entityId. + message SelectEntity { + // Required. Selectors choosing feature values of which entity id to be + // deleted from the EntityType. + EntityIdSelector entity_id_selector = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // Message to select time range and feature. + // Values of the selected feature generated within an inclusive time range + // will be deleted. Using this option permanently deletes the feature values + // from the specified feature IDs within the specified time range. + // This might include data from the online storage. If you want to retain + // any deleted historical data in the online storage, you must re-ingest it. + message SelectTimeRangeAndFeature { + // Required. Select feature generated within a half-inclusive time range. + // The time range is lower inclusive and upper exclusive. + google.type.Interval time_range = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Selectors choosing which feature values to be deleted from the + // EntityType. + FeatureSelector feature_selector = 2 + [(google.api.field_behavior) = REQUIRED]; + + // If set, data will not be deleted from online storage. + // When time range is older than the data in online storage, setting this to + // be true will make the deletion have no impact on online serving. + bool skip_online_storage_delete = 3; + } + + // Defines options to select feature values to be deleted. + oneof DeleteOption { + // Select feature values to be deleted by specifying entities. + SelectEntity select_entity = 2; + + // Select feature values to be deleted by specifying time range and + // features. + SelectTimeRangeAndFeature select_time_range_and_feature = 3; + } + + // Required. The resource name of the EntityType grouping the Features for + // which values are being deleted from. 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" + } + ]; +} + +// Response message for +// [FeaturestoreService.DeleteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.DeleteFeatureValues]. +message DeleteFeatureValuesResponse { + // Response message if the request uses the SelectEntity option. + message SelectEntity { + // The count of deleted entity rows in the offline storage. + // Each row corresponds to the combination of an entity ID and a timestamp. + // One entity ID can have multiple rows in the offline storage. + int64 offline_storage_deleted_entity_row_count = 1; + + // The count of deleted entities in the online storage. + // Each entity ID corresponds to one entity. + int64 online_storage_deleted_entity_count = 2; + } + + // Response message if the request uses the SelectTimeRangeAndFeature option. + message SelectTimeRangeAndFeature { + // The count of the features or columns impacted. + // This is the same as the feature count in the request. + int64 impacted_feature_count = 1; + + // The count of modified entity rows in the offline storage. + // Each row corresponds to the combination of an entity ID and a timestamp. + // One entity ID can have multiple rows in the offline storage. + // Within each row, only the features specified in the request are + // deleted. + int64 offline_storage_modified_entity_row_count = 2; + + // The count of modified entities in the online storage. + // Each entity ID corresponds to one entity. + // Within each entity, only the features specified in the request are + // deleted. + int64 online_storage_modified_entity_count = 3; + } + + // Response based on which delete option is specified in the + // request + oneof response { + // Response for request specifying the entities to delete + SelectEntity select_entity = 1; + + // Response for request specifying time range and feature + SelectTimeRangeAndFeature select_time_range_and_feature = 2; + } +} + +// Selector for entityId. Getting ids from the given source. +message EntityIdSelector { + // Details about the source data, including the location of the storage and + // the format. + oneof EntityIdsSource { + // Source of Csv + CsvSource csv_source = 3; + } + + // Source column that holds entity IDs. If not provided, entity IDs are + // extracted from the column named `entity_id`. + string entity_id_field = 5; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto new file mode 100644 index 00000000000..83d2697a596 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto @@ -0,0 +1,116 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto new file mode 100644 index 00000000000..bd37178673b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto @@ -0,0 +1,177 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto new file mode 100644 index 00000000000..9d1c55ec7be --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto @@ -0,0 +1,286 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/cloud/aiplatform/v1beta1/service_networking.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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]; + + // Optional. Configuration for private service connect. + // + // [network][google.cloud.aiplatform.v1beta1.IndexEndpoint.network] and + // [private_service_connect_config][google.cloud.aiplatform.v1beta1.IndexEndpoint.private_service_connect_config] + // are mutually exclusive. + PrivateServiceConnectConfig private_service_connect_config = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the deployed index will be accessible through public + // endpoint. + bool public_endpoint_enabled = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. If + // [public_endpoint_enabled][google.cloud.aiplatform.v1beta1.IndexEndpoint.public_endpoint_enabled] + // is true, this field will be populated with the domain name to use for this + // index endpoint. + string public_endpoint_domain_name = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// 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 for SMALL shard: + // e2-standard-2 and all machine types available for MEDIUM and LARGE shard. + // + // Available machine types for MEDIUM shard: + // e2-standard-16 and all machine types available for LARGE shard. + // + // Available machine types for LARGE shard: + // e2-highmem-16, n2d-standard-32. + // + // n1-standard-16 and n1-standard-32 are still available, but we recommend + // e2-standard-16 and e2-highmem-16 for cost efficiency. + 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 should 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto new file mode 100644 index 00000000000..14d6fc58e00 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto @@ -0,0 +1,362 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_service.proto new file mode 100644 index 00000000000..6bbb3dda0bc --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_service.proto @@ -0,0 +1,356 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/io.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/io.proto new file mode 100644 index 00000000000..d9ed3c4581d --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/io.proto @@ -0,0 +1,109 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto new file mode 100644 index 00000000000..f0668a63137 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto @@ -0,0 +1,1372 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/nas_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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // 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 NasJob + rpc CreateNasJob(CreateNasJobRequest) returns (NasJob) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/nasJobs" + body: "nas_job" + }; + option (google.api.method_signature) = "parent,nas_job"; + } + + // Gets a NasJob + rpc GetNasJob(GetNasJobRequest) returns (NasJob) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/nasJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists NasJobs in a Location. + rpc ListNasJobs(ListNasJobsRequest) returns (ListNasJobsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/nasJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a NasJob. + rpc DeleteNasJob(DeleteNasJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/nasJobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Cancels a NasJob. + // Starts asynchronous cancellation on the NasJob. The server + // makes a best effort to cancel the job, but success is not + // guaranteed. Clients can use + // [JobService.GetNasJob][google.cloud.aiplatform.v1beta1.JobService.GetNasJob] + // or other methods to check whether the cancellation succeeded or whether the + // job completed despite cancellation. On successful cancellation, + // the NasJob is not deleted; instead it becomes a job with + // a [NasJob.error][google.cloud.aiplatform.v1beta1.NasJob.error] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`, and + // [NasJob.state][google.cloud.aiplatform.v1beta1.NasJob.state] is set to + // `CANCELLED`. + rpc CancelNasJob(CancelNasJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/nasJobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a NasTrialDetail. + rpc GetNasTrialDetail(GetNasTrialDetailRequest) returns (NasTrialDetail) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/nasJobs/*/nasTrialDetails/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List top NasTrialDetails of a NasJob. + rpc ListNasTrialDetails(ListNasTrialDetailsRequest) + returns (ListNasTrialDetailsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/nasJobs/*}/nasTrialDetails" + }; + option (google.api.method_signature) = "parent"; + } + + // 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. + // * `labels` supports general map functions that is: + // `labels.key=value` - key:value equality + // `labels.key:* - key existence + // + // 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"` + // * `labels.keyA=valueA` + // * `labels.keyB:*` + 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. + // * `labels` supports general map functions that is: + // `labels.key=value` - key:value equality + // `labels.key:* - key existence + // + // 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"` + // * `labels.keyA=valueA` + // * `labels.keyB:*` + 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. + // * `labels` supports general map functions that is: + // `labels.key=value` - key:value equality + // `labels.key:* - key existence + // + // 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"` + // * `labels.keyA=valueA` + // * `labels.keyB:*` + 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.CreateNasJob][google.cloud.aiplatform.v1beta1.JobService.CreateNasJob]. +message CreateNasJobRequest { + // Required. The resource name of the Location to create the NasJob 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 NasJob to create. + NasJob nas_job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [JobService.GetNasJob][google.cloud.aiplatform.v1beta1.JobService.GetNasJob]. +message GetNasJobRequest { + // Required. The name of the NasJob resource. + // Format: + // `projects/{project}/locations/{location}/nasJobs/{nas_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NasJob" + } + ]; +} + +// Request message for +// [JobService.ListNasJobs][google.cloud.aiplatform.v1beta1.JobService.ListNasJobs]. +message ListNasJobsRequest { + // Required. The resource name of the Location to list the NasJobs + // 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. + // * `labels` supports general map functions that is: + // `labels.key=value` - key:value equality + // `labels.key:* - key existence + // + // 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"` + // * `labels.keyA=valueA` + // * `labels.keyB:*` + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListNasJobsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListNasJobsResponse.next_page_token] + // of the previous + // [JobService.ListNasJobs][google.cloud.aiplatform.v1beta1.JobService.ListNasJobs] + // call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for +// [JobService.ListNasJobs][google.cloud.aiplatform.v1beta1.JobService.ListNasJobs] +message ListNasJobsResponse { + // List of NasJobs in the requested page. + // [NasJob.nas_job_output][google.cloud.aiplatform.v1beta1.NasJob.nas_job_output] + // of the jobs will not be returned. + repeated NasJob nas_jobs = 1; + + // A token to retrieve the next page of results. + // Pass to + // [ListNasJobsRequest.page_token][google.cloud.aiplatform.v1beta1.ListNasJobsRequest.page_token] + // to obtain that page. + string next_page_token = 2; +} + +// Request message for +// [JobService.DeleteNasJob][google.cloud.aiplatform.v1beta1.JobService.DeleteNasJob]. +message DeleteNasJobRequest { + // Required. The name of the NasJob resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/nasJobs/{nas_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NasJob" + } + ]; +} + +// Request message for +// [JobService.CancelNasJob][google.cloud.aiplatform.v1beta1.JobService.CancelNasJob]. +message CancelNasJobRequest { + // Required. The name of the NasJob to cancel. + // Format: + // `projects/{project}/locations/{location}/nasJobs/{nas_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NasJob" + } + ]; +} + +// Request message for +// [JobService.GetNasTrialDetail][google.cloud.aiplatform.v1beta1.JobService.GetNasTrialDetail]. +message GetNasTrialDetailRequest { + // Required. The name of the NasTrialDetail resource. + // Format: + // `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NasTrialDetail" + } + ]; +} + +// Request message for +// [JobService.ListNasTrialDetails][google.cloud.aiplatform.v1beta1.JobService.ListNasTrialDetails]. +message ListNasTrialDetailsRequest { + // Required. The name of the NasJob resource. + // Format: + // `projects/{project}/locations/{location}/nasJobs/{nas_job}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/NasJob" + } + ]; + + // The standard list page size. + int32 page_size = 2; + + // The standard list page token. + // Typically obtained via + // [ListNasTrialDetailsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListNasTrialDetailsResponse.next_page_token] + // of the previous + // [JobService.ListNasTrialDetails][google.cloud.aiplatform.v1beta1.JobService.ListNasTrialDetails] + // call. + string page_token = 3; +} + +// Response message for +// [JobService.ListNasTrialDetails][google.cloud.aiplatform.v1beta1.JobService.ListNasTrialDetails] +message ListNasTrialDetailsResponse { + // List of top NasTrials in the requested page. + repeated NasTrialDetail nas_trial_details = 1; + + // A token to retrieve the next page of results. + // Pass to + // [ListNasTrialDetailsRequest.page_token][google.cloud.aiplatform.v1beta1.ListNasTrialDetailsRequest.page_token] + // to obtain that page. + string next_page_token = 2; +} + +// 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. + // * `labels` supports general map functions that is: + // `labels.key=value` - key:value equality + // `labels.key:* - key existence + // + // 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"` + // * `labels.keyA=valueA` + // * `labels.keyB:*` + 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 effect 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. + // * `labels` supports general map functions that is: + // `labels.key=value` - key:value equality + // `labels.key:* - key existence + // + // 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"` + // * `labels.keyA=valueA` + // * `labels.keyB:*` + 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_state.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_state.proto new file mode 100644 index 00000000000..d06cc9c1773 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_state.proto @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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. Only jobs in the `RUNNING` state can be updated. + // After updating, the job goes back to the `RUNNING` state. + JOB_STATE_UPDATING = 10; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto new file mode 100644 index 00000000000..3e7e99a3b53 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto @@ -0,0 +1,42 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto new file mode 100644 index 00000000000..098ca31b443 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto @@ -0,0 +1,216 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto new file mode 100644 index 00000000000..59eec695498 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto @@ -0,0 +1,39 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/match_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/match_service.proto new file mode 100644 index 00000000000..07acb17b08f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/match_service.proto @@ -0,0 +1,176 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "MatchServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// MatchService is a Google managed service for efficient vector similarity +// search at scale. +service MatchService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Finds the nearest neighbors of each vector within the request. + rpc FindNeighbors(FindNeighborsRequest) returns (FindNeighborsResponse) { + option (google.api.http) = { + post: "/v1beta1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:findNeighbors" + body: "*" + }; + } + + // Reads the datapoints/vectors of the given IDs. + // A maximum of 1000 datapoints can be retrieved in a batch. + rpc ReadIndexDatapoints(ReadIndexDatapointsRequest) + returns (ReadIndexDatapointsResponse) { + option (google.api.http) = { + post: "/v1beta1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:readIndexDatapoints" + body: "*" + }; + } +} + +// The request message for +// [MatchService.FindNeighbors][google.cloud.aiplatform.v1beta1.MatchService.FindNeighbors]. +message FindNeighborsRequest { + // A query to find a number of the nearest neighbors (most similar vectors) + // of a vector. + message Query { + // Required. The datapoint/vector whose nearest neighbors should be searched + // for. + IndexDatapoint datapoint = 1 [(google.api.field_behavior) = REQUIRED]; + + // The number of nearest neighbors to be retrieved from database for each + // query. If not set, will use the default from the service configuration + // (https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes#nearest-neighbor-search-config). + int32 neighbor_count = 2; + + // Crowding 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. + // It's used for improving result diversity. + // This field is the maximum number of matches with the same crowding tag. + int32 per_crowding_attribute_neighbor_count = 3; + + // The number of neighbors to find via approximate search before + // exact reordering is performed. If not set, the default value from scam + // config is used; if set, this value must be > 0. + int32 approximate_neighbor_count = 4; + + // The fraction of the number of leaves to search, set at query time allows + // user to tune search performance. This value increase result in both + // search accuracy and latency increase. The value should be between 0.0 + // and 1.0. If not set or set to 0.0, query uses the default value specified + // in + // NearestNeighborSearchConfig.TreeAHConfig.fraction_leaf_nodes_to_search. + double fraction_leaf_nodes_to_search_override = 5; + } + + // Required. The name of the index endpoint. + // 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" + } + ]; + + // The ID of the DeploydIndex that will serve the request. This request is + // sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That + // IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index + // has a DeployedIndex.id field. + // The value of the field below must equal one of the DeployedIndex.id + // fields of the IndexEndpoint that is being called for this request. + string deployed_index_id = 2; + + // The list of queries. + repeated Query queries = 3; + + // If set to true, the full datapoints (including all vector values and + // restricts) of the nearest neighbors are returned. + // Note that returning full datapoint will significantly increase the + // latency and cost of the query. + bool return_full_datapoint = 4; +} + +// The response message for +// [MatchService.FindNeighbors][google.cloud.aiplatform.v1beta1.MatchService.FindNeighbors]. +message FindNeighborsResponse { + // A neighbor of the query vector. + message Neighbor { + // The datapoint of the neighbor. + // Note that full datapoints are returned only when "return_full_datapoint" + // is set to true. Otherwise, only the "datapoint_id" and "crowding_tag" + // fields are populated. + IndexDatapoint datapoint = 1; + + // The distance between the neighbor and the query vector. + double distance = 2; + } + + // Nearest neighbors for one query. + message NearestNeighbors { + // The ID of the query datapoint. + string id = 1; + + // All its neighbors. + repeated Neighbor neighbors = 2; + } + + // The nearest neighbors of the query datapoints. + repeated NearestNeighbors nearest_neighbors = 1; +} + +// The request message for +// [MatchService.ReadIndexDatapoints][google.cloud.aiplatform.v1beta1.MatchService.ReadIndexDatapoints]. +message ReadIndexDatapointsRequest { + // Required. The name of the index endpoint. + // 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" + } + ]; + + // The ID of the DeploydIndex that will serve the request. + string deployed_index_id = 2; + + // IDs of the datapoints to be searched for. + repeated string ids = 3; +} + +// The response message for +// [MatchService.ReadIndexDatapoints][google.cloud.aiplatform.v1beta1.MatchService.ReadIndexDatapoints]. +message ReadIndexDatapointsResponse { + // The result list of datapoints. + repeated IndexDatapoint datapoints = 1; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto new file mode 100644 index 00000000000..01d3bdde90d --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto @@ -0,0 +1,80 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto new file mode 100644 index 00000000000..74ecdb97318 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto @@ -0,0 +1,1392 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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"; + } + + // Remove a set of children contexts from a parent Context. If any of the + // child Contexts were NOT added to the parent Context, they are + // simply skipped. + rpc RemoveContextChildren(RemoveContextChildrenRequest) + returns (RemoveContextChildrenResponse) { + option (google.api.http) = { + post: "/v1beta1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:removeContextChildren" + 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`). Maximum nested expression depth allowed + // is 5. + // + // For example: `display_name = "test" AND metadata.field1.bool_value = true`. + string filter = 4; + + // How the list of messages is ordered. Specify the values to order by and an + // ordering operation. The default sorting order is ascending. To specify + // descending order for a field, users append a " desc" suffix; for example: + // "foo desc, bar". + // Subfields are specified with a `.` character, such as foo.bar. + // see https://google.aip.dev/132#ordering for more details. + string order_by = 5; +} + +// 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`). Maximum nested expression depth allowed + // is 5. + // + // For example: `display_name = "test" AND metadata.field1.bool_value = true`. + string filter = 4; + + // How the list of messages is ordered. Specify the values to order by and an + // ordering operation. The default sorting order is ascending. To specify + // descending order for a field, users append a " desc" suffix; for example: + // "foo desc, bar". + // Subfields are specified with a `.` character, such as foo.bar. + // see https://google.aip.dev/132#ordering for more details. + string order_by = 5; +} + +// 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.DeleteContextChildrenRequest][]. +message RemoveContextChildrenRequest { + // 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.RemoveContextChildren][google.cloud.aiplatform.v1beta1.MetadataService.RemoveContextChildren]. +message RemoveContextChildrenResponse {} + +// 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`). Maximum nested expression depth allowed + // is 5. + // + // For example: `display_name = "test" AND metadata.field1.bool_value = true`. + string filter = 4; + + // How the list of messages is ordered. Specify the values to order by and an + // ordering operation. The default sorting order is ascending. To specify + // descending order for a field, users append a " desc" suffix; for example: + // "foo desc, bar". + // Subfields are specified with a `.` character, such as foo.bar. + // see https://google.aip.dev/132#ordering for more details. + string order_by = 5; +} + +// 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`). Maximum nested expression depth allowed + // is 5. + // + // For example: `display_name = "test" AND metadata.field1.bool_value = true`. + string filter = 3; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_store.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_store.proto new file mode 100644 index 00000000000..c4d16500e66 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_store.proto @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto new file mode 100644 index 00000000000..907f06c237e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto @@ -0,0 +1,155 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/migration_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/migration_service.proto new file mode 100644 index 00000000000..f67773bc787 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/migration_service.proto @@ -0,0 +1,321 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto new file mode 100644 index 00000000000..3dd24837ff2 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto @@ -0,0 +1,724 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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]; + } + + // Contains information about the original Model if this Model is a copy. + message OriginalModelInfo { + // Output only. The resource name of the Model this Model is a copy of, + // including the revision. Format: + // `projects/{project}/locations/{location}/models/{model_id}@{version_id}` + string model = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + } + + // 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 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 or Large 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 or Large 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][google.cloud.aiplatform.v1beta1.PredictionService.Explain] + // after being + // [deployed][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel] if + // it is populated. The Model can be used for [batch + // explanation][google.cloud.aiplatform.v1beta1.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][google.cloud.aiplatform.v1beta1.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][google.cloud.aiplatform.v1beta1.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; + + // Output only. Source of a model. It can either be automl training pipeline, + // custom training pipeline, BigQuery ML, or existing Vertex AI Model. + ModelSourceInfo model_source_info = 38 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If this Model is a copy of another Model, this contains info + // about the original. + OriginalModelInfo original_model_info = 34 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource name of the Artifact that was created in + // MetadataStore when creating the Model. The Artifact resource name pattern + // is + // `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`. + string metadata_artifact = 44 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// 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; +} + +// Detail description of the source information of the model. +message ModelSourceInfo { + // Source of the model. + enum ModelSourceType { + // Should not be used. + MODEL_SOURCE_TYPE_UNSPECIFIED = 0; + + // The Model is uploaded by automl training pipeline. + AUTOML = 1; + + // The Model is uploaded by user or custom training pipeline. + CUSTOM = 2; + + // The Model is registered and sync'ed from BigQuery ML. + BQML = 3; + + // The Model is saved or tuned from Model Garden. + MODEL_GARDEN = 4; + } + + // Type of the model source. + ModelSourceType source_type = 1; + + // If this Model is copy of another Model. If true then + // [source_type][google.cloud.aiplatform.v1beta1.ModelSourceInfo.source_type] + // pertains to the original. + bool copy = 2; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto new file mode 100644 index 00000000000..b28a4e6ac71 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto @@ -0,0 +1,326 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto new file mode 100644 index 00000000000..862679989fc --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto @@ -0,0 +1,96 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto new file mode 100644 index 00000000000..e1aba074a85 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto @@ -0,0 +1,194 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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 { + // Specification for how the data should be sliced. + message SliceSpec { + // Specification message containing the config for this SliceSpec. + // When `kind` is selected as `value` and/or `range`, only a single slice + // will be computed. + // When `all_values` is present, a separate slice will be computed for + // each possible label/value for the corresponding key in `config`. + // Examples, with feature zip_code with values 12345, 23334, 88888 and + // feature country with values "US", "Canada", "Mexico" in the dataset: + // + // Example 1: + // + // { + // "zip_code": { "value": { "float_value": 12345.0 } } + // } + // + // A single slice for any data with zip_code 12345 in the dataset. + // + // Example 2: + // + // { + // "zip_code": { "range": { "low": 12345, "high": 20000 } } + // } + // + // A single slice containing data where the zip_codes between 12345 and + // 20000 For this example, data with the zip_code of 12345 will be in this + // slice. + // + // Example 3: + // + // { + // "zip_code": { "range": { "low": 10000, "high": 20000 } }, + // "country": { "value": { "string_value": "US" } } + // } + // + // A single slice containing data where the zip_codes between 10000 and + // 20000 has the country "US". For this example, data with the zip_code of + // 12345 and country "US" will be in this slice. + // + // Example 4: + // + // { "country": {"all_values": { "value": true } } } + // + // Three slices are computed, one for each unique country in the dataset. + // + // Example 5: + // + // { + // "country": { "all_values": { "value": true } }, + // "zip_code": { "value": { "float_value": 12345.0 } } + // } + // + // Three slices are computed, one for each unique country in the dataset + // where the zip_code is also 12345. For this example, data with zip_code + // 12345 and country "US" will be in one slice, zip_code 12345 and country + // "Canada" in another slice, and zip_code 12345 and country "Mexico" in + // another slice, totaling 3 slices. + message SliceConfig { + oneof kind { + // A unique specific value for a given feature. + // Example: `{ "value": { "string_value": "12345" } }` + Value value = 1; + + // A range of values for a numerical feature. + // Example: `{"range":{"low":10000.0,"high":50000.0}}` + // will capture 12345 and 23334 in the slice. + Range range = 2; + + // If all_values is set to true, then all possible labels of the keyed + // feature will have another slice computed. + // Example: `{"all_values":{"value":true}}` + google.protobuf.BoolValue all_values = 3; + } + } + + // A range of values for slice(s). + // `low` is inclusive, `high` is exclusive. + message Range { + // Inclusive low value for the range. + float low = 1; + + // Exclusive high value for the range. + float high = 2; + } + + // Single value that supports strings and floats. + message Value { + oneof kind { + // String type. + string string_value = 1; + + // Float type. + float float_value = 2; + } + } + + // Mapping configuration for this SliceSpec. + // The key is the name of the feature. + // By default, the key will be prefixed by "instance" as a dictionary + // prefix for Vertex Batch Predictions output format. + map configs = 1; + } + + // 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]. + // * `slice`: This slice is a user customized slice defined by its + // SliceSpec. + 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. Specification for how the data was sliced. + SliceSpec slice_spec = 3 [(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]; + + // Output only. 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 tabular + // Models. + ModelExplanation model_explanation = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto new file mode 100644 index 00000000000..372c27ffa8e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto @@ -0,0 +1,250 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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"; +option (google.api.resource_definition) = { + type: "monitoring.googleapis.com/NotificationChannel" + pattern: "projects/{project}/notificationChannels/{notification_channel}" +}; + +// 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; + + // Resource names of the NotificationChannels to send alert. + // Must be of the format + // `projects//notificationChannels/` + repeated string notification_channels = 3 [(google.api.resource_reference) = { + type: "monitoring.googleapis.com/NotificationChannel" + }]; +} + +// 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto new file mode 100644 index 00000000000..5a766d0e834 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto @@ -0,0 +1,900 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/encryption_spec.proto"; +import "google/cloud/aiplatform/v1beta1/evaluated_annotation.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/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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][google.cloud.aiplatform.v1beta1.DeployedModel] 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" + }; + } + + // Copies an already existing Vertex AI Model into the specified Location. + // The source Model must exist in the same Project. + // When copying custom Models, the users themselves are responsible for + // [Model.metadata][google.cloud.aiplatform.v1beta1.Model.metadata] content to + // be region-agnostic, as well as making sure that any resources (e.g. files) + // it depends on remain accessible. + rpc CopyModel(CopyModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/models:copy" + body: "*" + }; + option (google.api.method_signature) = "parent,source_model"; + option (google.longrunning.operation_info) = { + response_type: "CopyModelResponse" + metadata_type: "CopyModelOperationMetadata" + }; + } + + // 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"; + } + + // Imports a list of externally generated EvaluatedAnnotations. + rpc BatchImportEvaluatedAnnotations(BatchImportEvaluatedAnnotationsRequest) + returns (BatchImportEvaluatedAnnotationsResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/models/*/evaluations/*/slices/*}:batchImport" + body: "*" + }; + option (google.api.method_signature) = "parent,evaluated_annotations"; + } + + // 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]; + + // Optional. The user-provided custom service account to use to do the model + // upload. If empty, [Vertex AI Service + // Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) + // will be used. Users uploading the Model must have the + // `iam.serviceAccounts.actAs` permission on this service account. Also, this + // account must belong to the project specified in the `parent` field and have + // all necessary read permissions. + string service_account = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// 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; + + // 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` + // + // Example: `update_time asc, create_time desc`. + string order_by = 6; +} + +// 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.CopyModel][google.cloud.aiplatform.v1beta1.ModelService.CopyModel]. +message CopyModelRequest { + // If both fields are unset, a new Model will be created with a generated ID. + oneof destination_model { + // Optional. Copy source_model into a new Model with this ID. The ID 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 = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specify this field to copy source_model into this existing + // Model as a new version. Format: + // `projects/{project}/locations/{location}/models/{model}` + string parent_model = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + } + + // Required. The resource name of the Location into which to copy the Model. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The resource name of the Model to copy. That Model must be in the + // same Project. Format: + // `projects/{project}/locations/{location}/models/{model}` + string source_model = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // Customer-managed encryption key options. If this is set, + // then the Model copy will be encrypted with the provided encryption key. + EncryptionSpec encryption_spec = 3; +} + +// Details of +// [ModelService.CopyModel][google.cloud.aiplatform.v1beta1.ModelService.CopyModel] +// operation. +message CopyModelOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; +} + +// Response message of +// [ModelService.CopyModel][google.cloud.aiplatform.v1beta1.ModelService.CopyModel] +// operation. +message CopyModelResponse { + // The name of the copied 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 copied. + string model_version_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// 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.BatchImportEvaluatedAnnotations][google.cloud.aiplatform.v1beta1.ModelService.BatchImportEvaluatedAnnotations] +message BatchImportEvaluatedAnnotationsRequest { + // Required. The name of the parent ModelEvaluationSlice resource. + // Format: + // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelEvaluationSlice" + } + ]; + + // Required. Evaluated annotations resource to be imported. + repeated EvaluatedAnnotation evaluated_annotations = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for +// [ModelService.BatchImportEvaluatedAnnotations][google.cloud.aiplatform.v1beta1.ModelService.BatchImportEvaluatedAnnotations] +message BatchImportEvaluatedAnnotationsResponse { + // Output only. Number of EvaluatedAnnotations imported. + int32 imported_evaluated_annotations_count = 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/nas_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/nas_job.proto new file mode 100644 index 00000000000..01c07031796 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/nas_job.proto @@ -0,0 +1,306 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "NasJobProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Represents a Neural Architecture Search (NAS) job. +message NasJob { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/NasJob" + pattern: "projects/{project}/locations/{location}/nasJobs/{nas_job}" + }; + + // Output only. Resource name of the NasJob. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the NasJob. + // 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]; + + // Required. The specification of a NasJob. + NasJobSpec nas_job_spec = 4 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Output of the NasJob. + NasJobOutput nas_job_output = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed state of the job. + JobState state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the NasJob was created. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the NasJob for the first time entered the + // `JOB_STATE_RUNNING` state. + google.protobuf.Timestamp start_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the NasJob entered any of the following states: + // `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. + google.protobuf.Timestamp end_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the NasJob was most recently updated. + google.protobuf.Timestamp update_time = 10 + [(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 = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize NasJobs. + // + // 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 = 12; + + // Customer-managed encryption key options for a NasJob. + // If this is set, then all resources created by the NasJob + // will be encrypted with the provided encryption key. + EncryptionSpec encryption_spec = 13; + + // Optional. Enable a separation of Custom model training + // and restricted image training for tenant project. + bool enable_restricted_image_training = 14 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; +} + +// Represents a NasTrial details along with it's parameters. If there is a +// corresponding train NasTrial, the train NasTrial is also returned. +message NasTrialDetail { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/NasTrialDetail" + pattern: "projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}" + }; + + // Output only. Resource name of the NasTrialDetail. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The parameters for the NasJob NasTrial. + string parameters = 2; + + // The requested search NasTrial. + NasTrial search_trial = 3; + + // The train NasTrial corresponding to + // [search_trial][google.cloud.aiplatform.v1beta1.NasTrialDetail.search_trial]. + // Only populated if + // [search_trial][google.cloud.aiplatform.v1beta1.NasTrialDetail.search_trial] + // is used for training. + NasTrial train_trial = 4; +} + +// Represents the spec of a NasJob. +message NasJobSpec { + // The spec of multi-trial Neural Architecture Search (NAS). + message MultiTrialAlgorithmSpec { + // 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. + string metric_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The optimization goal of the metric. + GoalType goal = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Represent spec for search trials. + message SearchTrialSpec { + // Required. The spec of a search trial job. The same spec applies to + // all search trials. + CustomJobSpec search_trial_job_spec = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The maximum number of Neural Architecture Search (NAS) trials + // to run. + int32 max_trial_count = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The maximum number of trials to run in parallel. + int32 max_parallel_trial_count = 3 + [(google.api.field_behavior) = REQUIRED]; + + // The number of failed trials that need to be seen before failing + // the NasJob. + // + // If set to 0, Vertex AI decides how many trials must fail + // before the whole job fails. + int32 max_failed_trial_count = 4; + } + + // Represent spec for train trials. + message TrainTrialSpec { + // Required. The spec of a train trial job. The same spec applies to + // all train trials. + CustomJobSpec train_trial_job_spec = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The maximum number of trials to run in parallel. + int32 max_parallel_trial_count = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Frequency of search trials to start train stage. Top N + // [TrainTrialSpec.max_parallel_trial_count] + // search trials will be trained for every M + // [TrainTrialSpec.frequency] trials searched. + int32 frequency = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // The available types of multi-trial algorithms. + enum MultiTrialAlgorithm { + // Defaults to `REINFORCEMENT_LEARNING`. + MULTI_TRIAL_ALGORITHM_UNSPECIFIED = 0; + + // The Reinforcement Learning Algorithm for Multi-trial Neural + // Architecture Search (NAS). + REINFORCEMENT_LEARNING = 1; + + // The Grid Search Algorithm for Multi-trial Neural + // Architecture Search (NAS). + GRID_SEARCH = 2; + } + + // The multi-trial Neural Architecture Search (NAS) algorithm + // type. Defaults to `REINFORCEMENT_LEARNING`. + MultiTrialAlgorithm multi_trial_algorithm = 1; + + // Metric specs for the NAS job. + // Validation for this field is done at `multi_trial_algorithm_spec` field. + MetricSpec metric = 2; + + // Required. Spec for search trials. + SearchTrialSpec search_trial_spec = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Spec for train trials. Top N [TrainTrialSpec.max_parallel_trial_count] + // search trials will be trained for every M + // [TrainTrialSpec.frequency] trials searched. + TrainTrialSpec train_trial_spec = 4; + } + + // The Neural Architecture Search (NAS) algorithm specification. + oneof nas_algorithm_spec { + // The spec of multi-trial algorithms. + MultiTrialAlgorithmSpec multi_trial_algorithm_spec = 2; + } + + // The ID of the existing NasJob in the same Project and Location + // which will be used to resume search. search_space_spec and + // nas_algorithm_spec are obtained from previous NasJob hence should not + // provide them again for this NasJob. + string resume_nas_job_id = 3; + + // It defines the search space for Neural Architecture Search (NAS). + string search_space_spec = 1; +} + +// Represents a uCAIP NasJob output. +message NasJobOutput { + // The output of a multi-trial Neural Architecture Search (NAS) jobs. + message MultiTrialJobOutput { + // Output only. List of NasTrials that were started as part of search stage. + repeated NasTrial search_trials = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of NasTrials that were started as part of train stage. + repeated NasTrial train_trials = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The output of this Neural Architecture Search (NAS) job. + oneof output { + // Output only. The output of this multi-trial Neural Architecture Search + // (NAS) job. + MultiTrialJobOutput multi_trial_job_output = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} + +// Represents a uCAIP NasJob trial. +message NasTrial { + // Describes a NasTrial state. + enum State { + // The NasTrial state is unspecified. + STATE_UNSPECIFIED = 0; + + // Indicates that a specific NasTrial has been requested, but it has not yet + // been suggested by the service. + REQUESTED = 1; + + // Indicates that the NasTrial has been suggested. + ACTIVE = 2; + + // Indicates that the NasTrial should stop according to the service. + STOPPING = 3; + + // Indicates that the NasTrial is completed successfully. + SUCCEEDED = 4; + + // Indicates that the NasTrial should not be attempted again. + // The service will set a NasTrial to INFEASIBLE when it's done but missing + // the final_measurement. + INFEASIBLE = 5; + } + + // Output only. The identifier of the NasTrial assigned by the service. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed state of the NasTrial. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The final measurement containing the objective value. + Measurement final_measurement = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the NasTrial was started. + google.protobuf.Timestamp start_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the NasTrial's status changed to `SUCCEEDED` or + // `INFEASIBLE`. + google.protobuf.Timestamp end_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/operation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/operation.proto new file mode 100644 index 00000000000..965d57a61b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/operation.proto @@ -0,0 +1,55 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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 Google Cloud 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_failure_policy.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_failure_policy.proto new file mode 100644 index 00000000000..14501c2f954 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_failure_policy.proto @@ -0,0 +1,44 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto new file mode 100644 index 00000000000..8878c8bdfbf --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto @@ -0,0 +1,409 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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 { + // 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.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; + + // 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 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 Google Cloud + // 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" + } + ]; + + // Output only. The names of the previously failed + // [CustomJob][google.cloud.aiplatform.v1beta1.CustomJob] for the main + // container executions. The list includes the all attempts in chronological + // order. + repeated string failed_main_jobs = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The names of the previously failed + // [CustomJob][google.cloud.aiplatform.v1beta1.CustomJob] for the + // pre-caching-check container executions. 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. The list + // includes the all attempts in chronological order. + repeated string failed_pre_caching_check_jobs = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The detailed info for a custom job executor. + message CustomJobDetail { + // 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" + } + ]; + + // Output only. The names of the previously failed + // [CustomJob][google.cloud.aiplatform.v1beta1.CustomJob]. The list includes + // the all attempts in chronological order. + repeated string failed_jobs = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + 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 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto new file mode 100644 index 00000000000..ef695f43b93 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto @@ -0,0 +1,450 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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. + // * `labels` supports general map functions that is: + // `labels.key=value` - key:value equality + // `labels.key:* - key existence + // + // 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; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 7; +} + +// 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto new file mode 100644 index 00000000000..d7cf152d66f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto @@ -0,0 +1,58 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto new file mode 100644 index 00000000000..2a07c70d22b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto @@ -0,0 +1,256 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/saved_query.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/saved_query.proto new file mode 100644 index 00000000000..d2abc05388a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/saved_query.proto @@ -0,0 +1,87 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule.proto new file mode 100644 index 00000000000..14113392316 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule.proto @@ -0,0 +1,151 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/pipeline_service.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "ScheduleProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// An instance of a Schedule periodically schedules runs to make API calls based +// on user specified time specification and API request type. +message Schedule { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Schedule" + pattern: "projects/{project}/locations/{location}/schedules/{schedule}" + }; + + // Possible state of the schedule. + enum State { + // Unspecified. + STATE_UNSPECIFIED = 0; + + // The Schedule is active. Runs are being scheduled on the user-specified + // timespec. + ACTIVE = 1; + + // The schedule is paused. No new runs will be created until the schedule + // is resumed. Already started runs will be allowed to complete. + PAUSED = 2; + + // The Schedule is completed. No new runs will be scheduled. Already started + // runs will be allowed to complete. Schedules in completed state cannot be + // paused or resumed. + COMPLETED = 3; + } + + // Required. + // The time specification to launch scheduled runs. + oneof time_specification { + // Cron schedule (https://en.wikipedia.org/wiki/Cron) to launch scheduled + // runs. To explicitly set a timezone to the cron tab, apply a prefix in the + // cron tab: "CRON_TZ=${IANA_TIME_ZONE}" or "TZ=${IANA_TIME_ZONE}". + // The ${IANA_TIME_ZONE} may only be a valid string from IANA time zone + // database. For example, "CRON_TZ=America/New_York 1 * * * *", or + // "TZ=America/New_York 1 * * * *". + string cron = 10; + } + + // Required. + // The API request template to launch the scheduled runs. + // User-specified ID is not supported in the request template. + oneof request { + // Request for + // [PipelineService.CreatePipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.CreatePipelineJob]. + // CreatePipelineJobRequest.parent field is required (format: + // projects/{project}/locations/{location}). + CreatePipelineJobRequest create_pipeline_job_request = 14; + } + + // Output only. The resource name of the Schedule. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. User provided name of the Schedule. + // 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]; + + // Optional. Timestamp after which the first run can be scheduled. + // Default to Schedule create time if not specified. + google.protobuf.Timestamp start_time = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Timestamp after which no new runs can be scheduled. + // If specified, The schedule will be completed when either + // end_time is reached or when scheduled_run_count >= max_run_count. + // If not specified, new runs will keep getting scheduled until this Schedule + // is paused or deleted. Already scheduled runs will be allowed to complete. + // Unset if not specified. + google.protobuf.Timestamp end_time = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum run count of the schedule. + // If specified, The schedule will be completed when either + // started_run_count >= max_run_count or when end_time is reached. + // If not specified, new runs will keep getting scheduled until this Schedule + // is paused or deleted. Already scheduled runs will be allowed to complete. + // Unset if not specified. + int64 max_run_count = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The number of runs started by this schedule. + int64 started_run_count = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of this Schedule. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Schedule was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Schedule should schedule the next run. + // Having a next_run_time in the past means the runs are being started + // behind schedule. + google.protobuf.Timestamp next_run_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Schedule was last paused. + // Unset if never paused. + google.protobuf.Timestamp last_pause_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Schedule was last resumed. + // Unset if never resumed from pause. + google.protobuf.Timestamp last_resume_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Maximum number of runs that can be executed concurrently for this + // Schedule. + int64 max_concurrent_run_count = 11 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Whether new scheduled runs can be queued when max_concurrent_runs + // limit is reached. If set to true, new runs will be queued instead of + // skipped. Default to false. + bool allow_queueing = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Whether to backfill missed runs when the schedule is resumed + // from PAUSED state. If set to true, all missed runs will be scheduled. New + // runs will be scheduled after the backfill is complete. Default to false. + bool catch_up = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule_service.proto new file mode 100644 index 00000000000..74bebf386ca --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule_service.proto @@ -0,0 +1,275 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/schedule.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "ScheduleServiceProto"; +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 Schedule resources to +// periodically launch shceudled runs to make API calls. +service ScheduleService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a Schedule. + rpc CreateSchedule(CreateScheduleRequest) returns (Schedule) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/schedules" + body: "schedule" + }; + option (google.api.method_signature) = "parent,schedule"; + } + + // Deletes a Schedule. + rpc DeleteSchedule(DeleteScheduleRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/schedules/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Gets a Schedule. + rpc GetSchedule(GetScheduleRequest) returns (Schedule) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/schedules/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Schedules in a Location. + rpc ListSchedules(ListSchedulesRequest) returns (ListSchedulesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/schedules" + }; + option (google.api.method_signature) = "parent"; + } + + // Pauses a Schedule. Will mark + // [Schedule.state][google.cloud.aiplatform.v1beta1.Schedule.state] to + // 'PAUSED'. If the schedule is paused, no new runs will be created. Already + // created runs will NOT be paused or canceled. + rpc PauseSchedule(PauseScheduleRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/schedules/*}:pause" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Resumes a paused Schedule to start scheduling new runs. Will mark + // [Schedule.state][google.cloud.aiplatform.v1beta1.Schedule.state] to + // 'ACTIVE'. Only paused Schedule can be resumed. + // + // When the Schedule is resumed, new runs will be scheduled starting from the + // next execution time after the current time based on the time_specification + // in the Schedule. If [Schedule.catchUp][] is set up true, all + // missed runs will be scheduled for backfill first. + rpc ResumeSchedule(ResumeScheduleRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/schedules/*}:resume" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for +// [ScheduleService.CreateSchedule][google.cloud.aiplatform.v1beta1.ScheduleService.CreateSchedule]. +message CreateScheduleRequest { + // Required. The resource name of the Location to create the Schedule 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 Schedule to create. + Schedule schedule = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [ScheduleService.GetSchedule][google.cloud.aiplatform.v1beta1.ScheduleService.GetSchedule]. +message GetScheduleRequest { + // Required. The name of the Schedule resource. + // Format: + // `projects/{project}/locations/{location}/schedules/{schedule}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Schedule" + } + ]; +} + +// Request message for +// [ScheduleService.ListSchedules][google.cloud.aiplatform.v1beta1.ScheduleService.ListSchedules]. +message ListSchedulesRequest { + // Required. The resource name of the Location to list the Schedules 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 Schedules that match the filter expression. The following + // fields are supported: + // + // * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + // * `state`: Supports `=` and `!=` comparisons. + // * `request`: Supports existence of the check. + // (e.g. `create_pipeline_job_request:*` --> Schedule has + // create_pipeline_job_request). + // * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + // Values must be in RFC 3339 format. + // * `start_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + // Values must be in RFC 3339 format. + // * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, `>=` comparisons and `:*` + // existence check. Values must be in RFC 3339 format. + // * `next_run_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` + // comparisons. Values must be in RFC 3339 format. + // + // + // Filter expressions can be combined together using logical operators + // (`NOT`, `AND` & `OR`). + // The syntax to define filter expression is based on + // https://google.aip.dev/160. + // + // Examples: + // + // * `state="ACTIVE" AND display_name:"my_schedule_*"` + // * `NOT display_name="my_schedule"` + // * `create_time>"2021-05-18T00:00:00Z"` + // * `end_time>"2021-05-18T00:00:00Z" OR NOT end_time:*` + // * `create_pipeline_job_request:*` + string filter = 2; + + // The standard list page size. + // Default to 100 if not specified. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListSchedulesResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListSchedulesResponse.next_page_token] + // of the previous + // [ScheduleService.ListSchedules][google.cloud.aiplatform.v1beta1.ScheduleService.ListSchedules] + // 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. + // + // For example, using "create_time desc, end_time" will order results by + // create time in descending order, and if there are multiple schedules 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 with create_time in + // descending order. + // + // Supported fields: + // * `create_time` + // * `start_time` + // * `end_time` + // * `next_run_time` + string order_by = 5; +} + +// Response message for +// [ScheduleService.ListSchedules][google.cloud.aiplatform.v1beta1.ScheduleService.ListSchedules] +message ListSchedulesResponse { + // List of Schedules in the requested page. + repeated Schedule schedules = 1; + + // A token to retrieve the next page of results. + // Pass to + // [ListSchedulesRequest.page_token][google.cloud.aiplatform.v1beta1.ListSchedulesRequest.page_token] + // to obtain that page. + string next_page_token = 2; +} + +// Request message for +// [ScheduleService.DeleteSchedule][google.cloud.aiplatform.v1beta1.ScheduleService.DeleteSchedule]. +message DeleteScheduleRequest { + // Required. The name of the Schedule resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/schedules/{schedule}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Schedule" + } + ]; +} + +// Request message for +// [ScheduleService.PauseSchedule][google.cloud.aiplatform.v1beta1.ScheduleService.PauseSchedule]. +message PauseScheduleRequest { + // Required. The name of the Schedule resource to be paused. + // Format: + // `projects/{project}/locations/{location}/schedules/{schedule}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Schedule" + } + ]; +} + +// Request message for +// [ScheduleService.ResumeSchedule][google.cloud.aiplatform.v1beta1.ScheduleService.ResumeSchedule]. +message ResumeScheduleRequest { + // Required. The name of the Schedule resource to be resumed. + // Format: + // `projects/{project}/locations/{location}/schedules/{schedule}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Schedule" + } + ]; + + // Optional. Whether to backfill missed runs when the schedule is resumed from + // PAUSED state. If set to true, all missed runs will be scheduled. New runs + // will be scheduled after the backfill is complete. This will also update + // [Schedule.catch_up][google.cloud.aiplatform.v1beta1.Schedule.catch_up] + // field. Default to false. + bool catch_up = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto new file mode 100644 index 00000000000..18950e8441e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/schemapb;schemapb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto new file mode 100644 index 00000000000..b5ae22ffc6e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/schemapb;schemapb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto new file mode 100644 index 00000000000..8911cd607f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/schemapb;schemapb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto new file mode 100644 index 00000000000..730280aee0b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/schemapb;schemapb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto new file mode 100644 index 00000000000..f196fe3524e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/schemapb;schemapb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto new file mode 100644 index 00000000000..3a9cd5b3b2c --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto new file mode 100644 index 00000000000..1edc6cc8e7f --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto new file mode 100644 index 00000000000..5056881c1e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto new file mode 100644 index 00000000000..bf773184d20 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto new file mode 100644 index 00000000000..764eeea7e4d --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto new file mode 100644 index 00000000000..73bf0893967 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto new file mode 100644 index 00000000000..570f0394e09 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto new file mode 100644 index 00000000000..52eee2a8136 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto new file mode 100644 index 00000000000..b347e992535 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto new file mode 100644 index 00000000000..8082195114a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/params/paramspb;paramspb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto new file mode 100644 index 00000000000..637d1569e68 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/params/paramspb;paramspb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto new file mode 100644 index 00000000000..47d8ddcf25a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/params/paramspb;paramspb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto new file mode 100644 index 00000000000..fad0f06ef8e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/params/paramspb;paramspb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto new file mode 100644 index 00000000000..57dc95f678b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/params/paramspb;paramspb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto new file mode 100644 index 00000000000..8232278bb06 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/params/paramspb;paramspb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto new file mode 100644 index 00000000000..1bd03d4de2e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto new file mode 100644 index 00000000000..3521f795569 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto new file mode 100644 index 00000000000..edd3a740b47 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto new file mode 100644 index 00000000000..ffdb995768e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto new file mode 100644 index 00000000000..65fd7cfcca2 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto new file mode 100644 index 00000000000..1b42997ee8c --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto new file mode 100644 index 00000000000..23c1b68a90d --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto new file mode 100644 index 00000000000..c9f641e6595 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto new file mode 100644 index 00000000000..30bfd9963c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto new file mode 100644 index 00000000000..faac51147e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto new file mode 100644 index 00000000000..6af9eea3d71 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto new file mode 100644 index 00000000000..1a2c9ede4f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto new file mode 100644 index 00000000000..b80309b501c --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto new file mode 100644 index 00000000000..b4385fbc0e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto new file mode 100644 index 00000000000..5930e169902 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto new file mode 100644 index 00000000000..61c16c434c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto new file mode 100644 index 00000000000..f92b0b467e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto new file mode 100644 index 00000000000..75563ff2a64 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto new file mode 100644 index 00000000000..130a2f0ebeb --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto new file mode 100644 index 00000000000..750ddfa4b92 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto new file mode 100644 index 00000000000..e69c1ab0301 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto new file mode 100644 index 00000000000..72132b3e3a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto new file mode 100644 index 00000000000..0fec2c8554e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; +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.search_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.mutate_deployed_model.jsinclude:samples/generated/v1/endpoint_service.mutate_deployed_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.write_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.delete_feature_values.jsinclude:samples/generated/v1/featurestore_service.delete_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_nas_job.jsinclude:samples/generated/v1/job_service.get_nas_job.jsinclude:samples/generated/v1/job_service.cancel_nas_job.jsinclude:samples/generated/v1/job_service.get_nas_trial_detail.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_nas_job.jsinclude:samples/generated/v1/job_service.delete_nas_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_nas_jobs.jsinclude:samples/generated/v1/job_service.list_nas_trial_details.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.remove_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.batch_import_evaluated_annotations.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.copy_model.jsinclude:samples/generated/v1/model_service.copy_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.read_tensorboard_usage.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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/service_networking.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/service_networking.proto new file mode 100644 index 00000000000..93afe75522e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/service_networking.proto @@ -0,0 +1,38 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "ServiceNetworkingProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Represents configuration for private service connect. +message PrivateServiceConnectConfig { + // Required. If true, expose the IndexEndpoint via private service connect. + bool enable_private_service_connect = 1 + [(google.api.field_behavior) = REQUIRED]; + + // A list of Projects from which the forwarding rule will target the service + // attachment. + repeated string project_allowlist = 2; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto new file mode 100644 index 00000000000..c579bafb768 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto @@ -0,0 +1,64 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto new file mode 100644 index 00000000000..db722c0e487 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto @@ -0,0 +1,225 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/study.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/study.proto new file mode 100644 index 00000000000..46a85557113 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/study.proto @@ -0,0 +1,663 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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 { + // Used in safe optimization to specify threshold levels and risk tolerance. + message SafetyMetricConfig { + // Safety threshold (boundary value between safe and unsafe). NOTE that if + // you leave SafetyMetricConfig unset, a default value of 0 will be used. + double safety_threshold = 1; + + // Desired minimum fraction of safe trials (over total number of trials) + // that should be targeted by the algorithm at any time during the + // study (best effort). This should be between 0.0 and 1.0 and a value of + // 0.0 means that there is no minimum and an algorithm proceeds without + // targeting any specific fraction. A value of 1.0 means that the + // algorithm attempts to only Suggest safe Trials. + optional double desired_min_safe_trials_fraction = 2; + } + + // 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]; + + // Used for safe search. In the case, the metric will be a safety + // metric. You must provide a separate metric for objective metric. + optional SafetyMetricConfig safety_config = 3; + } + + // 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; + + // ConvexAutomatedStoppingSpec by default only updates the trials that needs + // to be early stopped using a newly trained auto-regressive model. When + // this flag is set to True, all stopped trials from the beginning are + // potentially updated in terms of their `final_measurement`. Also, note + // that the training logic of autoregressive models is different in this + // case. Enabling this option has shown better results and this may be the + // default option in the future. + optional bool update_all_stopped_trials = 6; + } + + // 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; + } + + // This contains flag for manually disabling transfer learning for a study. + // The names of prior studies being used for transfer learning (if any) + // are also listed here. + message TransferLearningConfig { + // Flag to to manually prevent vizier from using transfer learning on a + // new study. Otherwise, vizier will automatically determine whether or not + // to use transfer learning. + bool disable_transfer_learning = 1; + + // Output only. Names of previously completed studies + repeated string prior_study_names = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // 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; + + // The configuration info/options for transfer learning. Currently supported + // for Vertex AI Vizier service, not HyperParameterTuningJob + TransferLearningConfig transfer_learning_config = 10; +} + +// 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto new file mode 100644 index 00000000000..83738c6fa3b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto @@ -0,0 +1,96 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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 Google Cloud 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; + + // Used to indicate if the TensorBoard instance is the default one. + // Each project & region can have at most one default TensorBoard instance. + // Creation of a default TensorBoard instance and updating an existing + // TensorBoard instance to be default will mark all other TensorBoard + // instances (if any) as non default. + bool is_default = 12; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto new file mode 100644 index 00000000000..86048f41639 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto @@ -0,0 +1,104 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto new file mode 100644 index 00000000000..b9801bf6452 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto @@ -0,0 +1,81 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto new file mode 100644 index 00000000000..682c20891bb --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto new file mode 100644 index 00000000000..0332db5dd4a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto @@ -0,0 +1,1131 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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"; + } + + // Returns a list of monthly active users for a given TensorBoard instance. + rpc ReadTensorboardUsage(ReadTensorboardUsageRequest) + returns (ReadTensorboardUsageResponse) { + option (google.api.http) = { + get: "/v1beta1/{tensorboard=projects/*/locations/*/tensorboards/*}:readUsage" + }; + option (google.api.method_signature) = "tensorboard"; + } + + // 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 is returned. + // Otherwise, the number limit of data points is 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 is returned. Otherwise, 1000 + // data points is 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 is 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 is 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.GetTensorboardUsage][]. +message ReadTensorboardUsageRequest { + // Required. The name of the Tensorboard resource. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + string tensorboard = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Tensorboard" + } + ]; +} + +// Response message for +// [TensorboardService.ReadTensorboardUsage][google.cloud.aiplatform.v1beta1.TensorboardService.ReadTensorboardUsage]. +message ReadTensorboardUsageResponse { + // Per user usage data. + message PerUserUsageData { + // User's username + string username = 1; + + // Number of times the user has read data within the Tensorboard. + int64 view_count = 2; + } + + // Per month usage data + message PerMonthUsageData { + // Usage data for each user in the given month. + repeated PerUserUsageData user_usage_data = 1; + } + + // Maps year-month (YYYYMM) string to per month usage data. + map monthly_usage_data = 1; +} + +// 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 are + // returned. The maximum value is 100; values above 100 are 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 is overwritten if it's in the mask. If the + // user does not provide a mask then all fields are 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 becomes 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 are returned. The maximum value is 1000; values + // above 1000 are 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 is overwritten if it's in the mask. If the + // user does not provide a mask then all fields are 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 becomes 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 are + // returned. The maximum value is 1000; values above 1000 are 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 is overwritten if it's in the mask. If the + // user does not provide a mask then all fields are 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 becomes 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 are returned. The maximum value is 1000; values + // above 1000 are 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 is overwritten if it's in the mask. If the + // user does not provide a mask then all fields are 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 is 1000. Values must be between 1 and 10000. + // Values above 10000 are 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 is 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto new file mode 100644 index 00000000000..9985d67eebd --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto @@ -0,0 +1,112 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto new file mode 100644 index 00000000000..b631633c65c --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto @@ -0,0 +1,450 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +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 {@link google.cloud.aiplatform.v1beta1.Dataset | 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 {@link google.cloud.aiplatform.v1beta1.AnnotationSpec | 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 {@link google.cloud.aiplatform.v1beta1.Dataset | 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 {@link google.cloud.aiplatform.v1beta1.Dataset | 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 + * {@link google.cloud.aiplatform.v1beta1.Dataset | 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 {@link google.cloud.aiplatform.v1beta1.DataItem | 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 {@link google.cloud.aiplatform.v1beta1.DataItem | 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 + * {@link google.cloud.aiplatform.v1beta1.DataItem | 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; + } + /** + * Searches DataItems in a Dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.orderByDataItem + * A comma-separated list of data item fields to order by, sorted in + * ascending order. Use "desc" after a field name for descending. + * @param {google.cloud.aiplatform.v1beta1.SearchDataItemsRequest.OrderByAnnotation} request.orderByAnnotation + * Expression that allows ranking results based on annotation's property. + * @param {string} request.dataset + * Required. The resource name of the Dataset from which to search DataItems. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {string} request.savedQuery + * The resource name of a SavedQuery(annotation set in UI). + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` + * All of the search will be done in the context of this SavedQuery. + * @param {string} request.dataLabelingJob + * The resource name of a DataLabelingJob. + * Format: + * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + * If this field is set, all of the search will be done in the context of + * this DataLabelingJob. + * @param {string} request.dataItemFilter + * An expression for filtering the DataItem that will be returned. + * + * * `data_item_id` - for = or !=. + * * `labeled` - for = or !=. + * * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that + * have at least one annotation with annotation_spec_id = + * `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. + * + * For example: + * + * * `data_item=1` + * * `has_annotation(5)` + * @param {string} request.annotationsFilter + * An expression for filtering the Annotations that will be returned per + * DataItem. + * * `annotation_spec_id` - for = or !=. + * @param {string[]} request.annotationFilters + * An expression that specifies what Annotations will be returned per + * DataItem. Annotations satisfied either of the conditions will be returned. + * * `annotation_spec_id` - for = or !=. + * Must specify `saved_query_id=` - saved query id that annotations should + * belong to. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields of + * {@link google.cloud.aiplatform.v1beta1.DataItemView|DataItemView} to read. + * @param {number} request.annotationsLimit + * If set, only up to this many of Annotations will be returned per + * DataItemView. The maximum value is 1000. If not set, the maximum value will + * be used. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * Default and maximum page size is 100. + * @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 {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.SearchDataItemsResponse.next_page_token|SearchDataItemsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.DatasetService.SearchDataItems|DatasetService.SearchDataItems} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.aiplatform.v1beta1.DataItemView | DataItemView}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchDataItemsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchDataItems( + request?: protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDataItemView[], + protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest|null, + protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsResponse + ]>; + searchDataItems( + request: protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, + protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDataItemView>): void; + searchDataItems( + request: protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, + protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDataItemView>): void; + searchDataItems( + request?: protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, + protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDataItemView>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, + protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDataItemView>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDataItemView[], + protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest|null, + protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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': request.dataset ?? '', + }); + this.initialize(); + return this.innerApiCalls.searchDataItems(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.orderByDataItem + * A comma-separated list of data item fields to order by, sorted in + * ascending order. Use "desc" after a field name for descending. + * @param {google.cloud.aiplatform.v1beta1.SearchDataItemsRequest.OrderByAnnotation} request.orderByAnnotation + * Expression that allows ranking results based on annotation's property. + * @param {string} request.dataset + * Required. The resource name of the Dataset from which to search DataItems. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {string} request.savedQuery + * The resource name of a SavedQuery(annotation set in UI). + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` + * All of the search will be done in the context of this SavedQuery. + * @param {string} request.dataLabelingJob + * The resource name of a DataLabelingJob. + * Format: + * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + * If this field is set, all of the search will be done in the context of + * this DataLabelingJob. + * @param {string} request.dataItemFilter + * An expression for filtering the DataItem that will be returned. + * + * * `data_item_id` - for = or !=. + * * `labeled` - for = or !=. + * * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that + * have at least one annotation with annotation_spec_id = + * `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. + * + * For example: + * + * * `data_item=1` + * * `has_annotation(5)` + * @param {string} request.annotationsFilter + * An expression for filtering the Annotations that will be returned per + * DataItem. + * * `annotation_spec_id` - for = or !=. + * @param {string[]} request.annotationFilters + * An expression that specifies what Annotations will be returned per + * DataItem. Annotations satisfied either of the conditions will be returned. + * * `annotation_spec_id` - for = or !=. + * Must specify `saved_query_id=` - saved query id that annotations should + * belong to. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields of + * {@link google.cloud.aiplatform.v1beta1.DataItemView|DataItemView} to read. + * @param {number} request.annotationsLimit + * If set, only up to this many of Annotations will be returned per + * DataItemView. The maximum value is 1000. If not set, the maximum value will + * be used. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * Default and maximum page size is 100. + * @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 {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.SearchDataItemsResponse.next_page_token|SearchDataItemsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.DatasetService.SearchDataItems|DatasetService.SearchDataItems} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.aiplatform.v1beta1.DataItemView | DataItemView} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchDataItemsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchDataItemsStream( + request?: protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, + 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({ + 'dataset': request.dataset ?? '', + }); + const defaultCallSettings = this._defaults['searchDataItems']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchDataItems.createStream( + this.innerApiCalls.searchDataItems as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchDataItems`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.orderByDataItem + * A comma-separated list of data item fields to order by, sorted in + * ascending order. Use "desc" after a field name for descending. + * @param {google.cloud.aiplatform.v1beta1.SearchDataItemsRequest.OrderByAnnotation} request.orderByAnnotation + * Expression that allows ranking results based on annotation's property. + * @param {string} request.dataset + * Required. The resource name of the Dataset from which to search DataItems. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {string} request.savedQuery + * The resource name of a SavedQuery(annotation set in UI). + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` + * All of the search will be done in the context of this SavedQuery. + * @param {string} request.dataLabelingJob + * The resource name of a DataLabelingJob. + * Format: + * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + * If this field is set, all of the search will be done in the context of + * this DataLabelingJob. + * @param {string} request.dataItemFilter + * An expression for filtering the DataItem that will be returned. + * + * * `data_item_id` - for = or !=. + * * `labeled` - for = or !=. + * * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that + * have at least one annotation with annotation_spec_id = + * `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. + * + * For example: + * + * * `data_item=1` + * * `has_annotation(5)` + * @param {string} request.annotationsFilter + * An expression for filtering the Annotations that will be returned per + * DataItem. + * * `annotation_spec_id` - for = or !=. + * @param {string[]} request.annotationFilters + * An expression that specifies what Annotations will be returned per + * DataItem. Annotations satisfied either of the conditions will be returned. + * * `annotation_spec_id` - for = or !=. + * Must specify `saved_query_id=` - saved query id that annotations should + * belong to. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields of + * {@link google.cloud.aiplatform.v1beta1.DataItemView|DataItemView} to read. + * @param {number} request.annotationsLimit + * If set, only up to this many of Annotations will be returned per + * DataItemView. The maximum value is 1000. If not set, the maximum value will + * be used. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * Default and maximum page size is 100. + * @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 {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.SearchDataItemsResponse.next_page_token|SearchDataItemsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.DatasetService.SearchDataItems|DatasetService.SearchDataItems} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.aiplatform.v1beta1.DataItemView | DataItemView}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see 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_SearchDataItems_async + */ + searchDataItemsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, + 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({ + 'dataset': request.dataset ?? '', + }); + const defaultCallSettings = this._defaults['searchDataItems']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchDataItems.asyncIterate( + this.innerApiCalls['searchDataItems'] 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 {@link google.cloud.aiplatform.v1beta1.SavedQuery | 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 {@link google.cloud.aiplatform.v1beta1.SavedQuery | 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 + * {@link google.cloud.aiplatform.v1beta1.SavedQuery | 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 {@link google.cloud.aiplatform.v1beta1.Annotation | 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 {@link google.cloud.aiplatform.v1beta1.Annotation | 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 + * {@link google.cloud.aiplatform.v1beta1.Annotation | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_client_config.json new file mode 100644 index 00000000000..697d04ac3f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_client_config.json @@ -0,0 +1,84 @@ +{ + "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" + }, + "SearchDataItems": { + "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/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client.ts new file mode 100644 index 00000000000..b531629f15b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client.ts @@ -0,0 +1,3723 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1beta1.DeploymentResourcePool | 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 {@link google.cloud.aiplatform.v1beta1.DeploymentResourcePool | 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 {@link google.cloud.aiplatform.v1beta1.DeploymentResourcePool | 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 + * {@link google.cloud.aiplatform.v1beta1.DeploymentResourcePool | 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 {@link google.cloud.aiplatform.v1beta1.DeployedModel | 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 {@link google.cloud.aiplatform.v1beta1.DeployedModel | 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 + * {@link google.cloud.aiplatform.v1beta1.DeployedModel | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client_config.json new file mode 100644 index 00000000000..060fe05281c --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client.ts new file mode 100644 index 00000000000..60505b3ff92 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client.ts @@ -0,0 +1,3867 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1beta1.Endpoint | 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 {@link google.cloud.aiplatform.v1beta1.Endpoint | 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. + * + * If the first character is a letter, this value may be up to 63 characters, + * and valid characters are `[a-z0-9-]`. The last character must be a letter + * or number. + * + * If the first character is a number, this value may be up to 9 characters, + * and valid characters are `[0-9]` with no leading zeros. + * + * 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 [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"` + * @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 {@link google.cloud.aiplatform.v1beta1.Endpoint | 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 [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"` + * @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 {@link google.cloud.aiplatform.v1beta1.Endpoint | 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 [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"` + * @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 + * {@link google.cloud.aiplatform.v1beta1.Endpoint | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client_config.json new file mode 100644 index 00000000000..4775abb5f33 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts new file mode 100644 index 00000000000..7c351b6044e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts @@ -0,0 +1,2996 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, 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}; + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + 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') + }; + + // 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 {@link google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse | 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 {@link google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse | 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 {@link google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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); + } + + // -------------------- + // -- 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client_config.json new file mode 100644 index 00000000000..bbe56dc0064 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client.ts new file mode 100644 index 00000000000..ad0d1282c2a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client.ts @@ -0,0 +1,6148 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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; + const deleteFeatureValuesResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteFeatureValuesResponse') as gax.protobuf.Type; + const deleteFeatureValuesMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteFeatureValuesOperationMetadata') 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)), + deleteFeatureValues: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteFeatureValuesResponse.decode.bind(deleteFeatureValuesResponse), + deleteFeatureValuesMetadata.decode.bind(deleteFeatureValuesMetadata)) + }; + + // 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', 'deleteFeatureValues', '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 {@link google.cloud.aiplatform.v1beta1.Featurestore | 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 {@link google.cloud.aiplatform.v1beta1.EntityType | 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` + * * `offline_storage_ttl_days` (available in Preview) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.aiplatform.v1beta1.EntityType | 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 {@link google.cloud.aiplatform.v1beta1.Feature | 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 {@link google.cloud.aiplatform.v1beta1.Feature | 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` + * * `online_storage_ttl_days` (available in Preview) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://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 128 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. + * @param {google.protobuf.Timestamp} [request.startTime] + * Optional. 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://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; + } +/** + * Delete Feature values from Featurestore. + * + * The progress of the deletion is tracked by the returned operation. The + * deleted feature values are guaranteed to be invisible to subsequent read + * operations after the operation is marked as successfully done. + * + * If a delete feature values operation fails, the feature values + * returned from reads and exports may be inconsistent. If consistency is + * required, the caller must retry the same delete request again and wait till + * the new operation returned is marked as successfully done. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.DeleteFeatureValuesRequest.SelectEntity} request.selectEntity + * Select feature values to be deleted by specifying entities. + * @param {google.cloud.aiplatform.v1beta1.DeleteFeatureValuesRequest.SelectTimeRangeAndFeature} request.selectTimeRangeAndFeature + * Select feature values to be deleted by specifying time range and + * features. + * @param {string} request.entityType + * Required. The resource name of the EntityType grouping the Features for + * which values are being deleted from. Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{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_DeleteFeatureValues_async + */ + deleteFeatureValues( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteFeatureValuesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteFeatureValues( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteFeatureValuesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFeatureValues( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteFeatureValuesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFeatureValues( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteFeatureValuesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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.deleteFeatureValues(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteFeatureValues()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://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_DeleteFeatureValues_async + */ + async checkDeleteFeatureValuesProgress(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.deleteFeatureValues, 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 {@link google.cloud.aiplatform.v1beta1.Featurestore | 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 {@link google.cloud.aiplatform.v1beta1.Featurestore | 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 + * {@link google.cloud.aiplatform.v1beta1.Featurestore | 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 {@link google.cloud.aiplatform.v1beta1.EntityType | 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 {@link google.cloud.aiplatform.v1beta1.EntityType | 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 + * {@link google.cloud.aiplatform.v1beta1.EntityType | 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 {@link google.cloud.aiplatform.v1beta1.Feature | 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 {@link google.cloud.aiplatform.v1beta1.Feature | 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 + * {@link google.cloud.aiplatform.v1beta1.Feature | 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 {@link google.cloud.aiplatform.v1beta1.Feature | 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 {@link google.cloud.aiplatform.v1beta1.Feature | 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 + * {@link google.cloud.aiplatform.v1beta1.Feature | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client_config.json new file mode 100644 index 00000000000..210e871c485 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client_config.json @@ -0,0 +1,129 @@ +{ + "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" + }, + "DeleteFeatureValues": { + "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/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..283ed5b2e87 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/gapic_metadata.json @@ -0,0 +1,2623 @@ +{ + "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" + ] + }, + "SearchDataItems": { + "methods": [ + "searchDataItems", + "searchDataItemsStream", + "searchDataItemsAsync" + ] + }, + "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" + ] + }, + "SearchDataItems": { + "methods": [ + "searchDataItems", + "searchDataItemsStream", + "searchDataItemsAsync" + ] + }, + "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" + ] + }, + "DeleteFeatureValues": { + "methods": [ + "deleteFeatureValues" + ] + }, + "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" + ] + }, + "DeleteFeatureValues": { + "methods": [ + "deleteFeatureValues" + ] + }, + "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" + ] + }, + "CreateNasJob": { + "methods": [ + "createNasJob" + ] + }, + "GetNasJob": { + "methods": [ + "getNasJob" + ] + }, + "CancelNasJob": { + "methods": [ + "cancelNasJob" + ] + }, + "GetNasTrialDetail": { + "methods": [ + "getNasTrialDetail" + ] + }, + "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" + ] + }, + "DeleteNasJob": { + "methods": [ + "deleteNasJob" + ] + }, + "DeleteBatchPredictionJob": { + "methods": [ + "deleteBatchPredictionJob" + ] + }, + "UpdateModelDeploymentMonitoringJob": { + "methods": [ + "updateModelDeploymentMonitoringJob" + ] + }, + "DeleteModelDeploymentMonitoringJob": { + "methods": [ + "deleteModelDeploymentMonitoringJob" + ] + }, + "ListCustomJobs": { + "methods": [ + "listCustomJobs", + "listCustomJobsStream", + "listCustomJobsAsync" + ] + }, + "ListDataLabelingJobs": { + "methods": [ + "listDataLabelingJobs", + "listDataLabelingJobsStream", + "listDataLabelingJobsAsync" + ] + }, + "ListHyperparameterTuningJobs": { + "methods": [ + "listHyperparameterTuningJobs", + "listHyperparameterTuningJobsStream", + "listHyperparameterTuningJobsAsync" + ] + }, + "ListNasJobs": { + "methods": [ + "listNasJobs", + "listNasJobsStream", + "listNasJobsAsync" + ] + }, + "ListNasTrialDetails": { + "methods": [ + "listNasTrialDetails", + "listNasTrialDetailsStream", + "listNasTrialDetailsAsync" + ] + }, + "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" + ] + }, + "CreateNasJob": { + "methods": [ + "createNasJob" + ] + }, + "GetNasJob": { + "methods": [ + "getNasJob" + ] + }, + "CancelNasJob": { + "methods": [ + "cancelNasJob" + ] + }, + "GetNasTrialDetail": { + "methods": [ + "getNasTrialDetail" + ] + }, + "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" + ] + }, + "DeleteNasJob": { + "methods": [ + "deleteNasJob" + ] + }, + "DeleteBatchPredictionJob": { + "methods": [ + "deleteBatchPredictionJob" + ] + }, + "UpdateModelDeploymentMonitoringJob": { + "methods": [ + "updateModelDeploymentMonitoringJob" + ] + }, + "DeleteModelDeploymentMonitoringJob": { + "methods": [ + "deleteModelDeploymentMonitoringJob" + ] + }, + "ListCustomJobs": { + "methods": [ + "listCustomJobs", + "listCustomJobsStream", + "listCustomJobsAsync" + ] + }, + "ListDataLabelingJobs": { + "methods": [ + "listDataLabelingJobs", + "listDataLabelingJobsStream", + "listDataLabelingJobsAsync" + ] + }, + "ListHyperparameterTuningJobs": { + "methods": [ + "listHyperparameterTuningJobs", + "listHyperparameterTuningJobsStream", + "listHyperparameterTuningJobsAsync" + ] + }, + "ListNasJobs": { + "methods": [ + "listNasJobs", + "listNasJobsStream", + "listNasJobsAsync" + ] + }, + "ListNasTrialDetails": { + "methods": [ + "listNasTrialDetails", + "listNasTrialDetailsStream", + "listNasTrialDetailsAsync" + ] + }, + "ListBatchPredictionJobs": { + "methods": [ + "listBatchPredictionJobs", + "listBatchPredictionJobsStream", + "listBatchPredictionJobsAsync" + ] + }, + "SearchModelDeploymentMonitoringStatsAnomalies": { + "methods": [ + "searchModelDeploymentMonitoringStatsAnomalies", + "searchModelDeploymentMonitoringStatsAnomaliesStream", + "searchModelDeploymentMonitoringStatsAnomaliesAsync" + ] + }, + "ListModelDeploymentMonitoringJobs": { + "methods": [ + "listModelDeploymentMonitoringJobs", + "listModelDeploymentMonitoringJobsStream", + "listModelDeploymentMonitoringJobsAsync" + ] + } + } + } + } + }, + "MatchService": { + "clients": { + "grpc": { + "libraryClient": "MatchServiceClient", + "rpcs": { + "FindNeighbors": { + "methods": [ + "findNeighbors" + ] + }, + "ReadIndexDatapoints": { + "methods": [ + "readIndexDatapoints" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "MatchServiceClient", + "rpcs": { + "FindNeighbors": { + "methods": [ + "findNeighbors" + ] + }, + "ReadIndexDatapoints": { + "methods": [ + "readIndexDatapoints" + ] + } + } + } + } + }, + "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" + ] + }, + "RemoveContextChildren": { + "methods": [ + "removeContextChildren" + ] + }, + "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" + ] + }, + "RemoveContextChildren": { + "methods": [ + "removeContextChildren" + ] + }, + "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" + ] + }, + "BatchImportEvaluatedAnnotations": { + "methods": [ + "batchImportEvaluatedAnnotations" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "GetModelEvaluationSlice": { + "methods": [ + "getModelEvaluationSlice" + ] + }, + "UploadModel": { + "methods": [ + "uploadModel" + ] + }, + "UpdateExplanationDataset": { + "methods": [ + "updateExplanationDataset" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "DeleteModelVersion": { + "methods": [ + "deleteModelVersion" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "CopyModel": { + "methods": [ + "copyModel" + ] + }, + "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" + ] + }, + "BatchImportEvaluatedAnnotations": { + "methods": [ + "batchImportEvaluatedAnnotations" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "GetModelEvaluationSlice": { + "methods": [ + "getModelEvaluationSlice" + ] + }, + "UploadModel": { + "methods": [ + "uploadModel" + ] + }, + "UpdateExplanationDataset": { + "methods": [ + "updateExplanationDataset" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "DeleteModelVersion": { + "methods": [ + "deleteModelVersion" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "CopyModel": { + "methods": [ + "copyModel" + ] + }, + "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" + ] + } + } + } + } + }, + "ScheduleService": { + "clients": { + "grpc": { + "libraryClient": "ScheduleServiceClient", + "rpcs": { + "CreateSchedule": { + "methods": [ + "createSchedule" + ] + }, + "GetSchedule": { + "methods": [ + "getSchedule" + ] + }, + "PauseSchedule": { + "methods": [ + "pauseSchedule" + ] + }, + "ResumeSchedule": { + "methods": [ + "resumeSchedule" + ] + }, + "DeleteSchedule": { + "methods": [ + "deleteSchedule" + ] + }, + "ListSchedules": { + "methods": [ + "listSchedules", + "listSchedulesStream", + "listSchedulesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ScheduleServiceClient", + "rpcs": { + "CreateSchedule": { + "methods": [ + "createSchedule" + ] + }, + "GetSchedule": { + "methods": [ + "getSchedule" + ] + }, + "PauseSchedule": { + "methods": [ + "pauseSchedule" + ] + }, + "ResumeSchedule": { + "methods": [ + "resumeSchedule" + ] + }, + "DeleteSchedule": { + "methods": [ + "deleteSchedule" + ] + }, + "ListSchedules": { + "methods": [ + "listSchedules", + "listSchedulesStream", + "listSchedulesAsync" + ] + } + } + } + } + }, + "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" + ] + }, + "ReadTensorboardUsage": { + "methods": [ + "readTensorboardUsage" + ] + }, + "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" + ] + }, + "ReadTensorboardUsage": { + "methods": [ + "readTensorboardUsage" + ] + }, + "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/google-cloud-aiplatform/v1beta1/src/v1beta1/index.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index.ts new file mode 100644 index 00000000000..b85f2840923 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index.ts @@ -0,0 +1,36 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {MatchServiceClient} from './match_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 {ScheduleServiceClient} from './schedule_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/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client.ts new file mode 100644 index 00000000000..1d878959242 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client.ts @@ -0,0 +1,3940 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1beta1.IndexEndpoint | 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 {@link google.cloud.aiplatform.v1beta1.IndexEndpoint | 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 {@link google.cloud.aiplatform.v1beta1.IndexEndpoint | 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 {@link google.cloud.aiplatform.v1beta1.IndexEndpoint | 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 + * {@link google.cloud.aiplatform.v1beta1.IndexEndpoint | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client_config.json new file mode 100644 index 00000000000..a2abf1a1867 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client.ts new file mode 100644 index 00000000000..10914fdaf07 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client.ts @@ -0,0 +1,3756 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1beta1.Index | 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 {@link google.cloud.aiplatform.v1beta1.UpsertDatapointsResponse | 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 {@link google.cloud.aiplatform.v1beta1.RemoveDatapointsResponse | 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 {@link google.cloud.aiplatform.v1beta1.Index | 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 {@link google.cloud.aiplatform.v1beta1.Index | 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 + * {@link google.cloud.aiplatform.v1beta1.Index | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client_config.json new file mode 100644 index 00000000000..18cb24612b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client.ts new file mode 100644 index 00000000000..7a8c10038dc --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client.ts @@ -0,0 +1,7277 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + 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'), + listNasJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'nasJobs'), + listNasTrialDetails: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'nasTrialDetails'), + 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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 deleteNasJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteNasJobMetadata = 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)), + deleteNasJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteNasJobResponse.decode.bind(deleteNasJobResponse), + deleteNasJobMetadata.decode.bind(deleteNasJobMetadata)), + 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', 'createNasJob', 'getNasJob', 'listNasJobs', 'deleteNasJob', 'cancelNasJob', 'getNasTrialDetail', 'listNasTrialDetails', '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', + '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 -- + // ------------------- +/** + * 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 {@link google.cloud.aiplatform.v1beta1.CustomJob | 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 {@link google.cloud.aiplatform.v1beta1.CustomJob | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1beta1.DataLabelingJob | 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 {@link google.cloud.aiplatform.v1beta1.DataLabelingJob | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob | 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 {@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob | 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 {@link google.protobuf.Empty | 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 NasJob + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the NasJob in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.NasJob} request.nasJob + * Required. The NasJob 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 {@link google.cloud.aiplatform.v1beta1.NasJob | NasJob}. + * Please see the + * [documentation](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_CreateNasJob_async + */ + createNasJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.INasJob, + protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest|undefined, {}|undefined + ]>; + createNasJob( + request: protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.INasJob, + protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest|null|undefined, + {}|null|undefined>): void; + createNasJob( + request: protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.INasJob, + protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest|null|undefined, + {}|null|undefined>): void; + createNasJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.INasJob, + protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.INasJob, + protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.INasJob, + protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createNasJob(request, options, callback); + } +/** + * Gets a NasJob + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the NasJob resource. + * Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_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 {@link google.cloud.aiplatform.v1beta1.NasJob | NasJob}. + * Please see the + * [documentation](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_GetNasJob_async + */ + getNasJob( + request?: protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.INasJob, + protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest|undefined, {}|undefined + ]>; + getNasJob( + request: protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.INasJob, + protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest|null|undefined, + {}|null|undefined>): void; + getNasJob( + request: protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.INasJob, + protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest|null|undefined, + {}|null|undefined>): void; + getNasJob( + request?: protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.INasJob, + protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.INasJob, + protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.INasJob, + protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getNasJob(request, options, callback); + } +/** + * Cancels a NasJob. + * Starts asynchronous cancellation on the NasJob. The server + * makes a best effort to cancel the job, but success is not + * guaranteed. Clients can use + * {@link google.cloud.aiplatform.v1beta1.JobService.GetNasJob|JobService.GetNasJob} + * or other methods to check whether the cancellation succeeded or whether the + * job completed despite cancellation. On successful cancellation, + * the NasJob is not deleted; instead it becomes a job with + * a {@link google.cloud.aiplatform.v1beta1.NasJob.error|NasJob.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.NasJob.state|NasJob.state} is set to + * `CANCELLED`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the NasJob to cancel. + * Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_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 {@link google.protobuf.Empty | 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_CancelNasJob_async + */ + cancelNasJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest|undefined, {}|undefined + ]>; + cancelNasJob( + request: protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest|null|undefined, + {}|null|undefined>): void; + cancelNasJob( + request: protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest|null|undefined, + {}|null|undefined>): void; + cancelNasJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.cancelNasJob(request, options, callback); + } +/** + * Gets a NasTrialDetail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the NasTrialDetail resource. + * Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.aiplatform.v1beta1.NasTrialDetail | NasTrialDetail}. + * Please see the + * [documentation](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_GetNasTrialDetail_async + */ + getNasTrialDetail( + request?: protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.INasTrialDetail, + protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest|undefined, {}|undefined + ]>; + getNasTrialDetail( + request: protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.INasTrialDetail, + protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest|null|undefined, + {}|null|undefined>): void; + getNasTrialDetail( + request: protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.INasTrialDetail, + protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest|null|undefined, + {}|null|undefined>): void; + getNasTrialDetail( + request?: protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.INasTrialDetail, + protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.INasTrialDetail, + protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.INasTrialDetail, + protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getNasTrialDetail(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 {@link google.cloud.aiplatform.v1beta1.BatchPredictionJob | 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 {@link google.cloud.aiplatform.v1beta1.BatchPredictionJob | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob | 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 {@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob | 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 {@link google.protobuf.Empty | 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 {@link google.protobuf.Empty | 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 NasJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the NasJob resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_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_DeleteNasJob_async + */ + deleteNasJob( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteNasJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteNasJob( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteNasJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteNasJob( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteNasJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteNasJob( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteNasJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteNasJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteNasJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://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_DeleteNasJob_async + */ + async checkDeleteNasJobProgress(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.deleteNasJob, 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1beta1.CustomJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1beta1.CustomJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 + * {@link google.cloud.aiplatform.v1beta1.CustomJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1beta1.DataLabelingJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1beta1.DataLabelingJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 + * {@link google.cloud.aiplatform.v1beta1.DataLabelingJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 + * {@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob | 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 NasJobs 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 NasJobs + * 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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.ListNasJobsResponse.next_page_token|ListNasJobsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.JobService.ListNasJobs|JobService.ListNasJobs} + * 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 {@link google.cloud.aiplatform.v1beta1.NasJob | NasJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listNasJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listNasJobs( + request?: protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.INasJob[], + protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListNasJobsResponse + ]>; + listNasJobs( + request: protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListNasJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.INasJob>): void; + listNasJobs( + request: protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListNasJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.INasJob>): void; + listNasJobs( + request?: protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListNasJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.INasJob>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListNasJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.INasJob>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.INasJob[], + protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListNasJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listNasJobs(request, options, callback); + } + +/** + * Equivalent to `method.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 NasJobs + * 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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.ListNasJobsResponse.next_page_token|ListNasJobsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.JobService.ListNasJobs|JobService.ListNasJobs} + * 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 {@link google.cloud.aiplatform.v1beta1.NasJob | NasJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listNasJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listNasJobsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, + 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['listNasJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNasJobs.createStream( + this.innerApiCalls.listNasJobs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listNasJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with 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 NasJobs + * 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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.ListNasJobsResponse.next_page_token|ListNasJobsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.JobService.ListNasJobs|JobService.ListNasJobs} + * 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 + * {@link google.cloud.aiplatform.v1beta1.NasJob | NasJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see 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_ListNasJobs_async + */ + listNasJobsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, + 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['listNasJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNasJobs.asyncIterate( + this.innerApiCalls['listNasJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List top NasTrialDetails of a NasJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the NasJob resource. + * Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @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.ListNasTrialDetailsResponse.next_page_token|ListNasTrialDetailsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.JobService.ListNasTrialDetails|JobService.ListNasTrialDetails} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.aiplatform.v1beta1.NasTrialDetail | NasTrialDetail}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listNasTrialDetailsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listNasTrialDetails( + request?: protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.INasTrialDetail[], + protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsResponse + ]>; + listNasTrialDetails( + request: protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, + protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.INasTrialDetail>): void; + listNasTrialDetails( + request: protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, + protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.INasTrialDetail>): void; + listNasTrialDetails( + request?: protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, + protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.INasTrialDetail>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, + protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.INasTrialDetail>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.INasTrialDetail[], + protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listNasTrialDetails(request, options, callback); + } + +/** + * Equivalent to `method.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 NasJob resource. + * Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @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.ListNasTrialDetailsResponse.next_page_token|ListNasTrialDetailsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.JobService.ListNasTrialDetails|JobService.ListNasTrialDetails} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.aiplatform.v1beta1.NasTrialDetail | NasTrialDetail} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listNasTrialDetailsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listNasTrialDetailsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, + 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['listNasTrialDetails']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNasTrialDetails.createStream( + this.innerApiCalls.listNasTrialDetails as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listNasTrialDetails`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with 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 NasJob resource. + * Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @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.ListNasTrialDetailsResponse.next_page_token|ListNasTrialDetailsResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.JobService.ListNasTrialDetails|JobService.ListNasTrialDetails} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.aiplatform.v1beta1.NasTrialDetail | NasTrialDetail}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see 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_ListNasTrialDetails_async + */ + listNasTrialDetailsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, + 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['listNasTrialDetails']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNasTrialDetails.asyncIterate( + this.innerApiCalls['listNasTrialDetails'] 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1beta1.BatchPredictionJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1beta1.BatchPredictionJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 + * {@link google.cloud.aiplatform.v1beta1.BatchPredictionJob | 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 {@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies | 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 {@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies | 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 + * {@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 {@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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"` + * * `labels.keyA=valueA` + * * `labels.keyB:*` + * @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 + * {@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client_config.json new file mode 100644 index 00000000000..4e60f4b5ff8 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client_config.json @@ -0,0 +1,194 @@ +{ + "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" + }, + "CreateNasJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetNasJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListNasJobs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteNasJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelNasJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetNasTrialDetail": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListNasTrialDetails": { + "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/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client.ts new file mode 100644 index 00000000000..d24e594f7ae --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client.ts @@ -0,0 +1,2934 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, 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/match_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './match_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * MatchService is a Google managed service for efficient vector similarity + * search at scale. + * @class + * @memberof v1beta1 + */ +export class MatchServiceClient { + 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}; + matchServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of MatchServiceClient. + * + * @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 MatchServiceClient({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 MatchServiceClient; + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.MatchService', 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.matchServiceStub) { + return this.matchServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.MatchService. + this.matchServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.MatchService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.MatchService, + 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 matchServiceStubMethods = + ['findNeighbors', 'readIndexDatapoints']; + for (const methodName of matchServiceStubMethods) { + const callPromise = this.matchServiceStub.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.matchServiceStub; + } + + /** + * 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 -- + // ------------------- +/** + * Finds the nearest neighbors of each vector within the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.indexEndpoint + * Required. The name of the index endpoint. + * Format: + * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + * @param {string} request.deployedIndexId + * The ID of the DeploydIndex that will serve the request. This request is + * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That + * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index + * has a DeployedIndex.id field. + * The value of the field below must equal one of the DeployedIndex.id + * fields of the IndexEndpoint that is being called for this request. + * @param {number[]} request.queries + * The list of queries. + * @param {boolean} request.returnFullDatapoint + * If set to true, the full datapoints (including all vector values and + * restricts) of the nearest neighbors are returned. + * Note that returning full datapoint will significantly increase the + * latency and cost of the query. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.aiplatform.v1beta1.FindNeighborsResponse | FindNeighborsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MatchService_FindNeighbors_async + */ + findNeighbors( + request?: protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IFindNeighborsResponse, + protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest|undefined, {}|undefined + ]>; + findNeighbors( + request: protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IFindNeighborsResponse, + protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest|null|undefined, + {}|null|undefined>): void; + findNeighbors( + request: protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IFindNeighborsResponse, + protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest|null|undefined, + {}|null|undefined>): void; + findNeighbors( + request?: protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IFindNeighborsResponse, + protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IFindNeighborsResponse, + protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IFindNeighborsResponse, + protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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.findNeighbors(request, options, callback); + } +/** + * Reads the datapoints/vectors of the given IDs. + * A maximum of 1000 datapoints can be retrieved in a batch. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.indexEndpoint + * Required. The name of the index endpoint. + * Format: + * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + * @param {string} request.deployedIndexId + * The ID of the DeploydIndex that will serve the request. + * @param {string[]} request.ids + * IDs of the datapoints to be searched for. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.aiplatform.v1beta1.ReadIndexDatapointsResponse | ReadIndexDatapointsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MatchService_ReadIndexDatapoints_async + */ + readIndexDatapoints( + request?: protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest|undefined, {}|undefined + ]>; + readIndexDatapoints( + request: protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest|null|undefined, + {}|null|undefined>): void; + readIndexDatapoints( + request: protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest|null|undefined, + {}|null|undefined>): void; + readIndexDatapoints( + request?: protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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.readIndexDatapoints(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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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); + } + + // -------------------- + // -- 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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.matchServiceStub && !this._terminated) { + return this.matchServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client_config.json new file mode 100644 index 00000000000..935371a2a10 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.MatchService": { + "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": { + "FindNeighbors": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReadIndexDatapoints": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client.ts new file mode 100644 index 00000000000..955ba5e0812 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client.ts @@ -0,0 +1,6791 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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', 'removeContextChildren', '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 {@link google.cloud.aiplatform.v1beta1.MetadataStore | 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 {@link google.cloud.aiplatform.v1beta1.Artifact | 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 {@link google.cloud.aiplatform.v1beta1.Artifact | 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 {@link google.cloud.aiplatform.v1beta1.Artifact | 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 {@link google.cloud.aiplatform.v1beta1.Context | 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 {@link google.cloud.aiplatform.v1beta1.Context | 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 {@link google.cloud.aiplatform.v1beta1.Context | 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 {@link google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsResponse | 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 {@link google.cloud.aiplatform.v1beta1.AddContextChildrenResponse | 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); + } +/** + * Remove a set of children contexts from a parent Context. If any of the + * child Contexts were NOT added to the parent 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 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 {@link google.cloud.aiplatform.v1beta1.RemoveContextChildrenResponse | RemoveContextChildrenResponse}. + * Please see the + * [documentation](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_RemoveContextChildren_async + */ + removeContextChildren( + request?: protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenResponse, + protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest|undefined, {}|undefined + ]>; + removeContextChildren( + request: protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenResponse, + protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest|null|undefined, + {}|null|undefined>): void; + removeContextChildren( + request: protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenResponse, + protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest|null|undefined, + {}|null|undefined>): void; + removeContextChildren( + request?: protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenResponse, + protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenResponse, + protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenResponse, + protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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.removeContextChildren(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 {@link google.cloud.aiplatform.v1beta1.LineageSubgraph | 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 {@link google.cloud.aiplatform.v1beta1.Execution | 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 {@link google.cloud.aiplatform.v1beta1.Execution | 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 {@link google.cloud.aiplatform.v1beta1.Execution | 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 {@link google.cloud.aiplatform.v1beta1.AddExecutionEventsResponse | 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 {@link google.cloud.aiplatform.v1beta1.LineageSubgraph | 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 {@link google.cloud.aiplatform.v1beta1.MetadataSchema | 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 {@link google.cloud.aiplatform.v1beta1.MetadataSchema | 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`). Maximum nested expression depth allowed + * is 5. + * + * 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 {@link google.cloud.aiplatform.v1beta1.LineageSubgraph | 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 {@link google.cloud.aiplatform.v1beta1.MetadataStore | 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 {@link google.cloud.aiplatform.v1beta1.MetadataStore | 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 + * {@link google.cloud.aiplatform.v1beta1.MetadataStore | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.aiplatform.v1beta1.Artifact | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.aiplatform.v1beta1.Artifact | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.aiplatform.v1beta1.Artifact | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.aiplatform.v1beta1.Context | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.aiplatform.v1beta1.Context | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.aiplatform.v1beta1.Context | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.aiplatform.v1beta1.Execution | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.aiplatform.v1beta1.Execution | 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`). Maximum nested expression depth allowed + * is 5. + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {string} request.orderBy + * How the list of messages is ordered. Specify the values to order by and an + * ordering operation. The default sorting order is ascending. To specify + * descending order for a field, users append a " desc" suffix; for example: + * "foo desc, bar". + * Subfields are specified with a `.` character, such as foo.bar. + * see https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.aiplatform.v1beta1.Execution | 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 {@link google.cloud.aiplatform.v1beta1.MetadataSchema | 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 {@link google.cloud.aiplatform.v1beta1.MetadataSchema | 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 + * {@link google.cloud.aiplatform.v1beta1.MetadataSchema | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client_config.json new file mode 100644 index 00000000000..feb78d10759 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client_config.json @@ -0,0 +1,179 @@ +{ + "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" + }, + "RemoveContextChildren": { + "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/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client.ts new file mode 100644 index 00000000000..43c798494c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client.ts @@ -0,0 +1,3356 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1beta1.MigratableResource | 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 {@link google.cloud.aiplatform.v1beta1.MigratableResource | 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 + * {@link google.cloud.aiplatform.v1beta1.MigratableResource | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client_config.json new file mode 100644 index 00000000000..10583430c90 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client.ts new file mode 100644 index 00000000000..f0db2e9d90a --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client.ts @@ -0,0 +1,5239 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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; + const copyModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.CopyModelResponse') as gax.protobuf.Type; + const copyModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.CopyModelOperationMetadata') 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)), + copyModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + copyModelResponse.decode.bind(copyModelResponse), + copyModelMetadata.decode.bind(copyModelMetadata)) + }; + + // 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', 'copyModel', 'importModelEvaluation', 'batchImportModelEvaluationSlices', 'batchImportEvaluatedAnnotations', '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 {@link google.cloud.aiplatform.v1beta1.Model | 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 {@link google.cloud.aiplatform.v1beta1.Model | 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 {@link google.cloud.aiplatform.v1beta1.Model | 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 {@link google.cloud.aiplatform.v1beta1.ModelEvaluation | 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 {@link google.cloud.aiplatform.v1beta1.BatchImportModelEvaluationSlicesResponse | 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); + } +/** + * Imports a list of externally generated EvaluatedAnnotations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent ModelEvaluationSlice resource. + * Format: + * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` + * @param {number[]} request.evaluatedAnnotations + * Required. Evaluated annotations 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 {@link google.cloud.aiplatform.v1beta1.BatchImportEvaluatedAnnotationsResponse | BatchImportEvaluatedAnnotationsResponse}. + * Please see the + * [documentation](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_BatchImportEvaluatedAnnotations_async + */ + batchImportEvaluatedAnnotations( + request?: protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest|undefined, {}|undefined + ]>; + batchImportEvaluatedAnnotations( + request: protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest|null|undefined, + {}|null|undefined>): void; + batchImportEvaluatedAnnotations( + request: protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest|null|undefined, + {}|null|undefined>): void; + batchImportEvaluatedAnnotations( + request?: protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchImportEvaluatedAnnotations(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 {@link google.cloud.aiplatform.v1beta1.ModelEvaluation | 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 {@link google.cloud.aiplatform.v1beta1.ModelEvaluationSlice | 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 {string} [request.serviceAccount] + * Optional. The user-provided custom service account to use to do the model + * upload. If empty, [Vertex AI Service + * Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) + * will be used. Users uploading the Model must have the + * `iam.serviceAccounts.actAs` permission on this service account. Also, this + * account must belong to the project specified in the `parent` field and have + * all necessary read permissions. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://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 google.cloud.aiplatform.v1beta1.DeployedModel|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 + * [supported export + * format][google.cloud.aiplatform.v1beta1.Model.supported_export_formats]. + * + * @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; + } +/** + * Copies an already existing Vertex AI Model into the specified Location. + * The source Model must exist in the same Project. + * When copying custom Models, the users themselves are responsible for + * {@link google.cloud.aiplatform.v1beta1.Model.metadata|Model.metadata} content to + * be region-agnostic, as well as making sure that any resources (e.g. files) + * it depends on remain accessible. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.modelId] + * Optional. Copy source_model into a new Model with this ID. The ID 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 {string} [request.parentModel] + * Optional. Specify this field to copy source_model into this existing + * Model as a new version. Format: + * `projects/{project}/locations/{location}/models/{model}` + * @param {string} request.parent + * Required. The resource name of the Location into which to copy the Model. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.sourceModel + * Required. The resource name of the Model to copy. That Model must be in the + * same Project. Format: + * `projects/{project}/locations/{location}/models/{model}` + * @param {google.cloud.aiplatform.v1beta1.EncryptionSpec} request.encryptionSpec + * Customer-managed encryption key options. If this is set, + * then the Model copy will be encrypted with the provided encryption key. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://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_CopyModel_async + */ + copyModel( + request?: protos.google.cloud.aiplatform.v1beta1.ICopyModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + copyModel( + request: protos.google.cloud.aiplatform.v1beta1.ICopyModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + copyModel( + request: protos.google.cloud.aiplatform.v1beta1.ICopyModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + copyModel( + request?: protos.google.cloud.aiplatform.v1beta1.ICopyModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.copyModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `copyModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://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_CopyModel_async + */ + async checkCopyModelProgress(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.copyModel, 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 [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"` + * @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 {@link google.cloud.aiplatform.v1beta1.Model | 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 [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"` + * @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 {@link google.cloud.aiplatform.v1beta1.Model | 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 [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"` + * @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 + * {@link google.cloud.aiplatform.v1beta1.Model | 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 {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` + * + * Example: `update_time asc, 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 {@link google.cloud.aiplatform.v1beta1.Model | 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 {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` + * + * Example: `update_time asc, 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 {@link google.cloud.aiplatform.v1beta1.Model | 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 {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` + * + * Example: `update_time asc, 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 + * {@link google.cloud.aiplatform.v1beta1.Model | 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 {@link google.cloud.aiplatform.v1beta1.ModelEvaluation | 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 {@link google.cloud.aiplatform.v1beta1.ModelEvaluation | 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 + * {@link google.cloud.aiplatform.v1beta1.ModelEvaluation | 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 {@link google.cloud.aiplatform.v1beta1.ModelEvaluationSlice | 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 {@link google.cloud.aiplatform.v1beta1.ModelEvaluationSlice | 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 + * {@link google.cloud.aiplatform.v1beta1.ModelEvaluationSlice | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client_config.json new file mode 100644 index 00000000000..d073f2cc96c --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client_config.json @@ -0,0 +1,109 @@ +{ + "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" + }, + "CopyModel": { + "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" + }, + "BatchImportEvaluatedAnnotations": { + "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/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client.ts new file mode 100644 index 00000000000..082c049c875 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client.ts @@ -0,0 +1,4304 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1beta1.TrainingPipeline | 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 {@link google.cloud.aiplatform.v1beta1.TrainingPipeline | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1beta1.PipelineJob | 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 {@link google.cloud.aiplatform.v1beta1.PipelineJob | 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 {@link google.protobuf.Empty | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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 {@link google.cloud.aiplatform.v1beta1.TrainingPipeline | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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 {@link google.cloud.aiplatform.v1beta1.TrainingPipeline | 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. + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* - key existence + * + * 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 + * {@link google.cloud.aiplatform.v1beta1.TrainingPipeline | 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 {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields 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 {@link google.cloud.aiplatform.v1beta1.PipelineJob | 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 {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields 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 {@link google.cloud.aiplatform.v1beta1.PipelineJob | 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 {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields 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 + * {@link google.cloud.aiplatform.v1beta1.PipelineJob | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client_config.json new file mode 100644 index 00000000000..dfa51e952eb --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client.ts new file mode 100644 index 00000000000..d405d8d6234 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client.ts @@ -0,0 +1,3071 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, 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}; + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.PredictionService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = 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' [Model's + * ][google.cloud.aiplatform.v1beta1.DeployedModel.model] + * {@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 {@link google.cloud.aiplatform.v1beta1.PredictResponse | 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 {@link google.api.HttpBody | 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' [Model's + * ][google.cloud.aiplatform.v1beta1.DeployedModel.model] + * {@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 {@link google.cloud.aiplatform.v1beta1.ExplainResponse | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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); + } + + // -------------------- + // -- 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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client_config.json new file mode 100644 index 00000000000..475b31fcf31 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client.ts new file mode 100644 index 00000000000..d7a7ea7f505 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client.ts @@ -0,0 +1,3770 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/schedule_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './schedule_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service for creating and managing Vertex AI's Schedule resources to + * periodically launch shceudled runs to make API calls. + * @class + * @memberof v1beta1 + */ +export class ScheduleServiceClient { + 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; + scheduleServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ScheduleServiceClient. + * + * @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 ScheduleServiceClient({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 ScheduleServiceClient; + 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + 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 = { + listSchedules: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'schedules') + }; + + 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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 deleteScheduleResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteScheduleMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + deleteSchedule: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteScheduleResponse.decode.bind(deleteScheduleResponse), + deleteScheduleMetadata.decode.bind(deleteScheduleMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.ScheduleService', 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.scheduleServiceStub) { + return this.scheduleServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.ScheduleService. + this.scheduleServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.ScheduleService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.ScheduleService, + 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 scheduleServiceStubMethods = + ['createSchedule', 'deleteSchedule', 'getSchedule', 'listSchedules', 'pauseSchedule', 'resumeSchedule']; + for (const methodName of scheduleServiceStubMethods) { + const callPromise = this.scheduleServiceStub.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.scheduleServiceStub; + } + + /** + * 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 Schedule. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the Schedule in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.Schedule} request.schedule + * Required. The Schedule 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 {@link google.cloud.aiplatform.v1beta1.Schedule | Schedule}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ScheduleService_CreateSchedule_async + */ + createSchedule( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ISchedule, + protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest|undefined, {}|undefined + ]>; + createSchedule( + request: protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ISchedule, + protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest|null|undefined, + {}|null|undefined>): void; + createSchedule( + request: protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ISchedule, + protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest|null|undefined, + {}|null|undefined>): void; + createSchedule( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ISchedule, + protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ISchedule, + protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ISchedule, + protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createSchedule(request, options, callback); + } +/** + * Gets a Schedule. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Schedule resource. + * Format: + * `projects/{project}/locations/{location}/schedules/{schedule}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.aiplatform.v1beta1.Schedule | Schedule}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ScheduleService_GetSchedule_async + */ + getSchedule( + request?: protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ISchedule, + protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest|undefined, {}|undefined + ]>; + getSchedule( + request: protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ISchedule, + protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest|null|undefined, + {}|null|undefined>): void; + getSchedule( + request: protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ISchedule, + protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest|null|undefined, + {}|null|undefined>): void; + getSchedule( + request?: protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ISchedule, + protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ISchedule, + protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ISchedule, + protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getSchedule(request, options, callback); + } +/** + * Pauses a Schedule. Will mark + * {@link google.cloud.aiplatform.v1beta1.Schedule.state|Schedule.state} to + * 'PAUSED'. If the schedule is paused, no new runs will be created. Already + * created runs will NOT be paused or canceled. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Schedule resource to be paused. + * Format: + * `projects/{project}/locations/{location}/schedules/{schedule}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.protobuf.Empty | 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_ScheduleService_PauseSchedule_async + */ + pauseSchedule( + request?: protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest|undefined, {}|undefined + ]>; + pauseSchedule( + request: protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest|null|undefined, + {}|null|undefined>): void; + pauseSchedule( + request: protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest|null|undefined, + {}|null|undefined>): void; + pauseSchedule( + request?: protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.pauseSchedule(request, options, callback); + } +/** + * Resumes a paused Schedule to start scheduling new runs. Will mark + * {@link google.cloud.aiplatform.v1beta1.Schedule.state|Schedule.state} to + * 'ACTIVE'. Only paused Schedule can be resumed. + * + * When the Schedule is resumed, new runs will be scheduled starting from the + * next execution time after the current time based on the time_specification + * in the Schedule. If {@link |Schedule.catchUp} is set up true, all + * missed runs will be scheduled for backfill first. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Schedule resource to be resumed. + * Format: + * `projects/{project}/locations/{location}/schedules/{schedule}` + * @param {boolean} [request.catchUp] + * Optional. Whether to backfill missed runs when the schedule is resumed from + * PAUSED state. If set to true, all missed runs will be scheduled. New runs + * will be scheduled after the backfill is complete. This will also update + * {@link google.cloud.aiplatform.v1beta1.Schedule.catch_up|Schedule.catch_up} + * field. Default to false. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.protobuf.Empty | 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_ScheduleService_ResumeSchedule_async + */ + resumeSchedule( + request?: protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest|undefined, {}|undefined + ]>; + resumeSchedule( + request: protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest|null|undefined, + {}|null|undefined>): void; + resumeSchedule( + request: protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest|null|undefined, + {}|null|undefined>): void; + resumeSchedule( + request?: protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.resumeSchedule(request, options, callback); + } + +/** + * Deletes a Schedule. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Schedule resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/schedules/{schedule}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ScheduleService_DeleteSchedule_async + */ + deleteSchedule( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteScheduleRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteSchedule( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteScheduleRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteSchedule( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteScheduleRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteSchedule( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteScheduleRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteSchedule(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteSchedule()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ScheduleService_DeleteSchedule_async + */ + async checkDeleteScheduleProgress(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.deleteSchedule, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Schedules 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 Schedules from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the Schedules that match the filter expression. The following + * fields are supported: + * + * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + * * `state`: Supports `=` and `!=` comparisons. + * * `request`: Supports existence of the check. + * (e.g. `create_pipeline_job_request:*` --> Schedule has + * create_pipeline_job_request). + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `start_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, `>=` comparisons and `:*` + * existence check. Values must be in RFC 3339 format. + * * `next_run_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` + * comparisons. Values must be in RFC 3339 format. + * + * + * Filter expressions can be combined together using logical operators + * (`NOT`, `AND` & `OR`). + * The syntax to define filter expression is based on + * https://google.aip.dev/160. + * + * Examples: + * + * * `state="ACTIVE" AND display_name:"my_schedule_*"` + * * `NOT display_name="my_schedule"` + * * `create_time>"2021-05-18T00:00:00Z"` + * * `end_time>"2021-05-18T00:00:00Z" OR NOT end_time:*` + * * `create_pipeline_job_request:*` + * @param {number} request.pageSize + * The standard list page size. + * Default to 100 if not specified. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListSchedulesResponse.next_page_token|ListSchedulesResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.ScheduleService.ListSchedules|ScheduleService.ListSchedules} + * 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. + * + * For example, using "create_time desc, end_time" will order results by + * create time in descending order, and if there are multiple schedules 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 with create_time in + * descending order. + * + * Supported fields: + * * `create_time` + * * `start_time` + * * `end_time` + * * `next_run_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 {@link google.cloud.aiplatform.v1beta1.Schedule | Schedule}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSchedulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSchedules( + request?: protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ISchedule[], + protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListSchedulesResponse + ]>; + listSchedules( + request: protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, + protos.google.cloud.aiplatform.v1beta1.IListSchedulesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ISchedule>): void; + listSchedules( + request: protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, + protos.google.cloud.aiplatform.v1beta1.IListSchedulesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ISchedule>): void; + listSchedules( + request?: protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, + protos.google.cloud.aiplatform.v1beta1.IListSchedulesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ISchedule>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, + protos.google.cloud.aiplatform.v1beta1.IListSchedulesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ISchedule>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ISchedule[], + protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListSchedulesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listSchedules(request, options, callback); + } + +/** + * Equivalent to `method.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 Schedules from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the Schedules that match the filter expression. The following + * fields are supported: + * + * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + * * `state`: Supports `=` and `!=` comparisons. + * * `request`: Supports existence of the check. + * (e.g. `create_pipeline_job_request:*` --> Schedule has + * create_pipeline_job_request). + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `start_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, `>=` comparisons and `:*` + * existence check. Values must be in RFC 3339 format. + * * `next_run_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` + * comparisons. Values must be in RFC 3339 format. + * + * + * Filter expressions can be combined together using logical operators + * (`NOT`, `AND` & `OR`). + * The syntax to define filter expression is based on + * https://google.aip.dev/160. + * + * Examples: + * + * * `state="ACTIVE" AND display_name:"my_schedule_*"` + * * `NOT display_name="my_schedule"` + * * `create_time>"2021-05-18T00:00:00Z"` + * * `end_time>"2021-05-18T00:00:00Z" OR NOT end_time:*` + * * `create_pipeline_job_request:*` + * @param {number} request.pageSize + * The standard list page size. + * Default to 100 if not specified. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListSchedulesResponse.next_page_token|ListSchedulesResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.ScheduleService.ListSchedules|ScheduleService.ListSchedules} + * 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. + * + * For example, using "create_time desc, end_time" will order results by + * create time in descending order, and if there are multiple schedules 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 with create_time in + * descending order. + * + * Supported fields: + * * `create_time` + * * `start_time` + * * `end_time` + * * `next_run_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 {@link google.cloud.aiplatform.v1beta1.Schedule | Schedule} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSchedulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSchedulesStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, + 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['listSchedules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSchedules.createStream( + this.innerApiCalls.listSchedules as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSchedules`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with 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 Schedules from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the Schedules that match the filter expression. The following + * fields are supported: + * + * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + * * `state`: Supports `=` and `!=` comparisons. + * * `request`: Supports existence of the check. + * (e.g. `create_pipeline_job_request:*` --> Schedule has + * create_pipeline_job_request). + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `start_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, `>=` comparisons and `:*` + * existence check. Values must be in RFC 3339 format. + * * `next_run_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` + * comparisons. Values must be in RFC 3339 format. + * + * + * Filter expressions can be combined together using logical operators + * (`NOT`, `AND` & `OR`). + * The syntax to define filter expression is based on + * https://google.aip.dev/160. + * + * Examples: + * + * * `state="ACTIVE" AND display_name:"my_schedule_*"` + * * `NOT display_name="my_schedule"` + * * `create_time>"2021-05-18T00:00:00Z"` + * * `end_time>"2021-05-18T00:00:00Z" OR NOT end_time:*` + * * `create_pipeline_job_request:*` + * @param {number} request.pageSize + * The standard list page size. + * Default to 100 if not specified. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListSchedulesResponse.next_page_token|ListSchedulesResponse.next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.ScheduleService.ListSchedules|ScheduleService.ListSchedules} + * 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. + * + * For example, using "create_time desc, end_time" will order results by + * create time in descending order, and if there are multiple schedules 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 with create_time in + * descending order. + * + * Supported fields: + * * `create_time` + * * `start_time` + * * `end_time` + * * `next_run_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 + * {@link google.cloud.aiplatform.v1beta1.Schedule | Schedule}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see 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_ScheduleService_ListSchedules_async + */ + listSchedulesAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, + 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['listSchedules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSchedules.asyncIterate( + this.innerApiCalls['listSchedules'] 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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.scheduleServiceStub && !this._terminated) { + return this.scheduleServiceStub.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/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client_config.json new file mode 100644 index 00000000000..10258b57ae6 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.ScheduleService": { + "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": { + "CreateSchedule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSchedule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSchedule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSchedules": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PauseSchedule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ResumeSchedule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client.ts new file mode 100644 index 00000000000..2289dedea89 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client.ts @@ -0,0 +1,3603 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1beta1.SpecialistPool | 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 {@link google.cloud.aiplatform.v1beta1.SpecialistPool | 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 {@link google.cloud.aiplatform.v1beta1.SpecialistPool | 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 + * {@link google.cloud.aiplatform.v1beta1.SpecialistPool | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client_config.json new file mode 100644 index 00000000000..c39dc80ff47 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client.ts new file mode 100644 index 00000000000..6aabfb4564d --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client.ts @@ -0,0 +1,6173 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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', 'readTensorboardUsage', '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 {@link google.cloud.aiplatform.v1beta1.Tensorboard | 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); + } +/** + * Returns a list of monthly active users for a given TensorBoard instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tensorboard + * 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 {@link google.cloud.aiplatform.v1beta1.ReadTensorboardUsageResponse | ReadTensorboardUsageResponse}. + * Please see the + * [documentation](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_ReadTensorboardUsage_async + */ + readTensorboardUsage( + request?: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageResponse, + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest|undefined, {}|undefined + ]>; + readTensorboardUsage( + request: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageResponse, + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest|null|undefined, + {}|null|undefined>): void; + readTensorboardUsage( + request: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageResponse, + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest|null|undefined, + {}|null|undefined>): void; + readTensorboardUsage( + request?: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageResponse, + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageResponse, + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageResponse, + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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.readTensorboardUsage(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 becomes 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 {@link google.cloud.aiplatform.v1beta1.TensorboardExperiment | 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 {@link google.cloud.aiplatform.v1beta1.TensorboardExperiment | 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 is overwritten if it's in the mask. If the + * user does not provide a mask then all fields are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardExperiment | 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 becomes 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 {@link google.cloud.aiplatform.v1beta1.TensorboardRun | 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 {@link google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsResponse | 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 {@link google.cloud.aiplatform.v1beta1.TensorboardRun | 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 is overwritten if it's in the mask. If the + * user does not provide a mask then all fields are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardRun | 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 {@link google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesResponse | 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 becomes 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 {@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries | 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 {@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries | 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 is overwritten if it's in the mask. If the + * user does not provide a mask then all fields are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries | 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 is returned. + * Otherwise, the number limit of data points is 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 {@link google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataResponse | 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 is returned. Otherwise, 1000 + * data points is 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 {@link google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataResponse | 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 is 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 {@link google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataResponse | 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 is 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 {@link google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataResponse | 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 {@link google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse | 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 is overwritten if it's in the mask. If the + * user does not provide a mask then all fields are 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 are + * returned. The maximum value is 100; values above 100 are 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 {@link google.cloud.aiplatform.v1beta1.Tensorboard | 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 are + * returned. The maximum value is 100; values above 100 are 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 {@link google.cloud.aiplatform.v1beta1.Tensorboard | 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 are + * returned. The maximum value is 100; values above 100 are 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 + * {@link google.cloud.aiplatform.v1beta1.Tensorboard | 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 are returned. The maximum value is 1000; values + * above 1000 are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardExperiment | 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 are returned. The maximum value is 1000; values + * above 1000 are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardExperiment | 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 are returned. The maximum value is 1000; values + * above 1000 are 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 + * {@link google.cloud.aiplatform.v1beta1.TensorboardExperiment | 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 are + * returned. The maximum value is 1000; values above 1000 are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardRun | 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 are + * returned. The maximum value is 1000; values above 1000 are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardRun | 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 are + * returned. The maximum value is 1000; values above 1000 are 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 + * {@link google.cloud.aiplatform.v1beta1.TensorboardRun | 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 are returned. The maximum value is 1000; values + * above 1000 are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries | 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 are returned. The maximum value is 1000; values + * above 1000 are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries | 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 are returned. The maximum value is 1000; values + * above 1000 are 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 + * {@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries | 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 is 1000. Values must be between 1 and 10000. + * Values above 10000 are 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 is 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 {@link google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint | 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 is 1000. Values must be between 1 and 10000. + * Values above 10000 are 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 is 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 {@link google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint | 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 is 1000. Values must be between 1 and 10000. + * Values above 10000 are 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 is 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 + * {@link google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client_config.json new file mode 100644 index 00000000000..58394e25501 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client_config.json @@ -0,0 +1,142 @@ +{ + "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" + }, + "ReadTensorboardUsage": { + "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/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client.ts new file mode 100644 index 00000000000..72fb92f614e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client.ts @@ -0,0 +1,4427 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + 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}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1beta1.Study | 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 {@link google.cloud.aiplatform.v1beta1.Study | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1beta1.Study | 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 {@link google.cloud.aiplatform.v1beta1.Trial | 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 {@link google.cloud.aiplatform.v1beta1.Trial | 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 {@link google.cloud.aiplatform.v1beta1.Trial | 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 {@link google.cloud.aiplatform.v1beta1.Trial | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1beta1.Trial | 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 {@link google.cloud.aiplatform.v1beta1.ListOptimalTrialsResponse | 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.aiplatform.v1beta1.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 {@link google.cloud.aiplatform.v1beta1.Study | 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 {@link google.cloud.aiplatform.v1beta1.Study | 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 + * {@link google.cloud.aiplatform.v1beta1.Study | 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 {@link google.cloud.aiplatform.v1beta1.Trial | 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 {@link google.cloud.aiplatform.v1beta1.Trial | 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 + * {@link google.cloud.aiplatform.v1beta1.Trial | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 + * {@link google.cloud.location.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project:string,location:string,nasJob:string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; + } + + /** + * 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 schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project:string,location:string,schedule:string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client_config.json new file mode 100644 index 00000000000..89e31e025cf --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_proto_list.json new file mode 100644 index 00000000000..9638e888ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_proto_list.json @@ -0,0 +1,127 @@ +[ + "../../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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..ba7cdcd7009 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,44 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 matchServiceClient = new aiplatform.MatchServiceClient(); + 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 scheduleServiceClient = new aiplatform.ScheduleServiceClient(); + const specialistPoolServiceClient = new aiplatform.SpecialistPoolServiceClient(); + const tensorboardServiceClient = new aiplatform.TensorboardServiceClient(); + const vizierServiceClient = new aiplatform.VizierServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..a023296296c --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,134 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, MatchServiceClient, MetadataServiceClient, MigrationServiceClient, ModelServiceClient, PipelineServiceClient, PredictionServiceClient, ScheduleServiceClient, 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 doStuffWithMatchServiceClient(client: MatchServiceClient) { + 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 doStuffWithScheduleServiceClient(client: ScheduleServiceClient) { + 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 matchServiceClient = new MatchServiceClient(); + doStuffWithMatchServiceClient(matchServiceClient); + // 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 scheduleServiceClient = new ScheduleServiceClient(); + doStuffWithScheduleServiceClient(scheduleServiceClient); + // 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/google-cloud-aiplatform/v1beta1/system-test/install.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/install.ts new file mode 100644 index 00000000000..c8f81b25a86 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/google-cloud-aiplatform/v1beta1/test/gapic_dataset_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_dataset_service_v1beta1.ts new file mode 100644 index 00000000000..68e5a05b222 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_dataset_service_v1beta1.ts @@ -0,0 +1,5006 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('searchDataItems', () => { + it('invokes searchDataItems 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.SearchDataItemsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.SearchDataItemsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), + ]; + client.innerApiCalls.searchDataItems = stubSimpleCall(expectedResponse); + const [response] = await client.searchDataItems(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchDataItems as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchDataItems as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchDataItems 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.SearchDataItemsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.SearchDataItemsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), + ]; + client.innerApiCalls.searchDataItems = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchDataItems( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDataItemView[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchDataItems as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchDataItems as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchDataItems 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.SearchDataItemsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.SearchDataItemsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchDataItems = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchDataItems(request), expectedError); + const actualRequest = (client.innerApiCalls.searchDataItems as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchDataItems as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchDataItemsStream 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.SearchDataItemsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.SearchDataItemsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), + ]; + client.descriptors.page.searchDataItems.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchDataItemsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.DataItemView[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DataItemView) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.searchDataItems.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchDataItems, request)); + assert( + (client.descriptors.page.searchDataItems.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchDataItemsStream 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.SearchDataItemsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.SearchDataItemsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchDataItems.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchDataItemsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.DataItemView[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DataItemView) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchDataItems.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchDataItems, request)); + assert( + (client.descriptors.page.searchDataItems.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchDataItems 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.SearchDataItemsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.SearchDataItemsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), + ]; + client.descriptors.page.searchDataItems.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IDataItemView[] = []; + const iterable = client.searchDataItemsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchDataItems.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchDataItems.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchDataItems 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.SearchDataItemsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.SearchDataItemsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchDataItems.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchDataItemsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IDataItemView[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchDataItems.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchDataItems.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_deployment_resource_pool_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_deployment_resource_pool_service_v1beta1.ts new file mode 100644 index 00000000000..99427c088ec --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_deployment_resource_pool_service_v1beta1.ts @@ -0,0 +1,3773 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_endpoint_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_endpoint_service_v1beta1.ts new file mode 100644 index 00000000000..d106d1a80ee --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_endpoint_service_v1beta1.ts @@ -0,0 +1,3918 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts new file mode 100644 index 00000000000..1fe783a3462 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts @@ -0,0 +1,2828 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_service_v1beta1.ts new file mode 100644 index 00000000000..40442e1b56b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_service_v1beta1.ts @@ -0,0 +1,6247 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('deleteFeatureValues', () => { + it('invokes deleteFeatureValues 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.DeleteFeatureValuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteFeatureValues = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteFeatureValues(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFeatureValues 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.DeleteFeatureValuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteFeatureValues = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFeatureValues( + request, + (err?: Error|null, + result?: 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.deleteFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFeatureValues 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.DeleteFeatureValuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeatureValues = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteFeatureValues(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFeatureValues 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.DeleteFeatureValuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteFeatureValues(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteFeatureValuesProgress 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.checkDeleteFeatureValuesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteFeatureValuesProgress 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.checkDeleteFeatureValuesProgress(''), 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts new file mode 100644 index 00000000000..8b5109064ea --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts @@ -0,0 +1,4072 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_index_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_service_v1beta1.ts new file mode 100644 index 00000000000..a64c07e1eb7 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_service_v1beta1.ts @@ -0,0 +1,3872 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_job_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_job_service_v1beta1.ts new file mode 100644 index 00000000000..fa8f7a6d761 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_job_service_v1beta1.ts @@ -0,0 +1,8039 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('createNasJob', () => { + it('invokes createNasJob 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.CreateNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CreateNasJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.NasJob() + ); + client.innerApiCalls.createNasJob = stubSimpleCall(expectedResponse); + const [response] = await client.createNasJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNasJob 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.CreateNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CreateNasJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.NasJob() + ); + client.innerApiCalls.createNasJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createNasJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.INasJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNasJob 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.CreateNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CreateNasJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNasJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createNasJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNasJob 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.CreateNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CreateNasJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createNasJob(request), expectedError); + }); + }); + + describe('getNasJob', () => { + it('invokes getNasJob 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.GetNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.NasJob() + ); + client.innerApiCalls.getNasJob = stubSimpleCall(expectedResponse); + const [response] = await client.getNasJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNasJob 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.GetNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.NasJob() + ); + client.innerApiCalls.getNasJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getNasJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.INasJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNasJob 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.GetNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNasJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getNasJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNasJob 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.GetNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getNasJob(request), expectedError); + }); + }); + + describe('cancelNasJob', () => { + it('invokes cancelNasJob 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.CancelNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CancelNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelNasJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelNasJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelNasJob 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.CancelNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CancelNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelNasJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelNasJob( + 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.cancelNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelNasJob 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.CancelNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CancelNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelNasJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelNasJob(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelNasJob 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.CancelNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CancelNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelNasJob(request), expectedError); + }); + }); + + describe('getNasTrialDetail', () => { + it('invokes getNasTrialDetail 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.GetNasTrialDetailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetNasTrialDetailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail() + ); + client.innerApiCalls.getNasTrialDetail = stubSimpleCall(expectedResponse); + const [response] = await client.getNasTrialDetail(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNasTrialDetail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNasTrialDetail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNasTrialDetail 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.GetNasTrialDetailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetNasTrialDetailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail() + ); + client.innerApiCalls.getNasTrialDetail = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getNasTrialDetail( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.INasTrialDetail|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNasTrialDetail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNasTrialDetail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNasTrialDetail 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.GetNasTrialDetailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetNasTrialDetailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNasTrialDetail = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getNasTrialDetail(request), expectedError); + const actualRequest = (client.innerApiCalls.getNasTrialDetail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNasTrialDetail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNasTrialDetail 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.GetNasTrialDetailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetNasTrialDetailRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getNasTrialDetail(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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('deleteNasJob', () => { + it('invokes deleteNasJob 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.DeleteNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteNasJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteNasJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNasJob 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.DeleteNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteNasJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteNasJob( + request, + (err?: Error|null, + result?: 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.deleteNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNasJob 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.DeleteNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNasJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteNasJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNasJob 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.DeleteNasJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteNasJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNasJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteNasJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteNasJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteNasJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteNasJobProgress 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.checkDeleteNasJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteNasJobProgress 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.checkDeleteNasJobProgress(''), 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('listNasJobs', () => { + it('invokes listNasJobs 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.ListNasJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), + ]; + client.innerApiCalls.listNasJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listNasJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listNasJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNasJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNasJobs 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.ListNasJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), + ]; + client.innerApiCalls.listNasJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNasJobs( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.INasJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listNasJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNasJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNasJobs 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.ListNasJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listNasJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listNasJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listNasJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNasJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNasJobsStream 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.ListNasJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), + ]; + client.descriptors.page.listNasJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listNasJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.NasJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.NasJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listNasJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listNasJobs, request)); + assert( + (client.descriptors.page.listNasJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listNasJobsStream 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.ListNasJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNasJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listNasJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.NasJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.NasJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listNasJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listNasJobs, request)); + assert( + (client.descriptors.page.listNasJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNasJobs 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.ListNasJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), + ]; + client.descriptors.page.listNasJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.INasJob[] = []; + const iterable = client.listNasJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listNasJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listNasJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNasJobs 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.ListNasJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNasJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listNasJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.INasJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listNasJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listNasJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listNasTrialDetails', () => { + it('invokes listNasTrialDetails 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.ListNasTrialDetailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasTrialDetailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), + ]; + client.innerApiCalls.listNasTrialDetails = stubSimpleCall(expectedResponse); + const [response] = await client.listNasTrialDetails(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listNasTrialDetails as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNasTrialDetails as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNasTrialDetails 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.ListNasTrialDetailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasTrialDetailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), + ]; + client.innerApiCalls.listNasTrialDetails = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNasTrialDetails( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.INasTrialDetail[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listNasTrialDetails as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNasTrialDetails as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNasTrialDetails 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.ListNasTrialDetailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasTrialDetailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listNasTrialDetails = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listNasTrialDetails(request), expectedError); + const actualRequest = (client.innerApiCalls.listNasTrialDetails as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listNasTrialDetails as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNasTrialDetailsStream 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.ListNasTrialDetailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasTrialDetailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), + ]; + client.descriptors.page.listNasTrialDetails.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listNasTrialDetailsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.NasTrialDetail[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.NasTrialDetail) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listNasTrialDetails.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listNasTrialDetails, request)); + assert( + (client.descriptors.page.listNasTrialDetails.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listNasTrialDetailsStream 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.ListNasTrialDetailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasTrialDetailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNasTrialDetails.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listNasTrialDetailsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.NasTrialDetail[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.NasTrialDetail) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listNasTrialDetails.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listNasTrialDetails, request)); + assert( + (client.descriptors.page.listNasTrialDetails.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNasTrialDetails 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.ListNasTrialDetailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasTrialDetailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), + ]; + client.descriptors.page.listNasTrialDetails.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.INasTrialDetail[] = []; + const iterable = client.listNasTrialDetailsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listNasTrialDetails.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listNasTrialDetails.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNasTrialDetails 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.ListNasTrialDetailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasTrialDetailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNasTrialDetails.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listNasTrialDetailsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.INasTrialDetail[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listNasTrialDetails.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listNasTrialDetails.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_match_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_match_service_v1beta1.ts new file mode 100644 index 00000000000..c5d4bf8d47e --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_match_service_v1beta1.ts @@ -0,0 +1,2717 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 matchserviceModule from '../src'; + +import {protobuf, 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.MatchServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = matchserviceModule.v1beta1.MatchServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = matchserviceModule.v1beta1.MatchServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = matchserviceModule.v1beta1.MatchServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new matchserviceModule.v1beta1.MatchServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.matchServiceStub, undefined); + await client.initialize(); + assert(client.matchServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.matchServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.matchServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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('findNeighbors', () => { + it('invokes findNeighbors without error', async () => { + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.FindNeighborsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.FindNeighborsRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.FindNeighborsResponse() + ); + client.innerApiCalls.findNeighbors = stubSimpleCall(expectedResponse); + const [response] = await client.findNeighbors(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.findNeighbors as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.findNeighbors as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes findNeighbors without error using callback', async () => { + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.FindNeighborsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.FindNeighborsRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.FindNeighborsResponse() + ); + client.innerApiCalls.findNeighbors = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.findNeighbors( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IFindNeighborsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.findNeighbors as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.findNeighbors as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes findNeighbors with error', async () => { + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.FindNeighborsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.FindNeighborsRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.findNeighbors = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.findNeighbors(request), expectedError); + const actualRequest = (client.innerApiCalls.findNeighbors as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.findNeighbors as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes findNeighbors with closed client', async () => { + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.FindNeighborsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.FindNeighborsRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.findNeighbors(request), expectedError); + }); + }); + + describe('readIndexDatapoints', () => { + it('invokes readIndexDatapoints without error', async () => { + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsResponse() + ); + client.innerApiCalls.readIndexDatapoints = stubSimpleCall(expectedResponse); + const [response] = await client.readIndexDatapoints(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.readIndexDatapoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readIndexDatapoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readIndexDatapoints without error using callback', async () => { + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsResponse() + ); + client.innerApiCalls.readIndexDatapoints = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.readIndexDatapoints( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.readIndexDatapoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readIndexDatapoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readIndexDatapoints with error', async () => { + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.readIndexDatapoints = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.readIndexDatapoints(request), expectedError); + const actualRequest = (client.innerApiCalls.readIndexDatapoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readIndexDatapoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readIndexDatapoints with closed client', async () => { + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.readIndexDatapoints(request), expectedError); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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('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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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 matchserviceModule.v1beta1.MatchServiceClient({ + 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/google-cloud-aiplatform/v1beta1/test/gapic_metadata_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_metadata_service_v1beta1.ts new file mode 100644 index 00000000000..abe03e18ea6 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_metadata_service_v1beta1.ts @@ -0,0 +1,7388 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('removeContextChildren', () => { + it('invokes removeContextChildren 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.RemoveContextChildrenRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.RemoveContextChildrenRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.RemoveContextChildrenResponse() + ); + client.innerApiCalls.removeContextChildren = stubSimpleCall(expectedResponse); + const [response] = await client.removeContextChildren(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.removeContextChildren as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.removeContextChildren as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeContextChildren 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.RemoveContextChildrenRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.RemoveContextChildrenRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.RemoveContextChildrenResponse() + ); + client.innerApiCalls.removeContextChildren = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeContextChildren( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.removeContextChildren as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.removeContextChildren as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeContextChildren 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.RemoveContextChildrenRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.RemoveContextChildrenRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.removeContextChildren = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.removeContextChildren(request), expectedError); + const actualRequest = (client.innerApiCalls.removeContextChildren as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.removeContextChildren as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeContextChildren 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.RemoveContextChildrenRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.RemoveContextChildrenRequest', ['context']); + request.context = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.removeContextChildren(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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_migration_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_migration_service_v1beta1.ts new file mode 100644 index 00000000000..34f6e810959 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_migration_service_v1beta1.ts @@ -0,0 +1,3236 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_model_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_model_service_v1beta1.ts new file mode 100644 index 00000000000..bf8333d4144 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_model_service_v1beta1.ts @@ -0,0 +1,5609 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('batchImportEvaluatedAnnotations', () => { + it('invokes batchImportEvaluatedAnnotations 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.BatchImportEvaluatedAnnotationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.BatchImportEvaluatedAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.BatchImportEvaluatedAnnotationsResponse() + ); + client.innerApiCalls.batchImportEvaluatedAnnotations = stubSimpleCall(expectedResponse); + const [response] = await client.batchImportEvaluatedAnnotations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchImportEvaluatedAnnotations 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.BatchImportEvaluatedAnnotationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.BatchImportEvaluatedAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.BatchImportEvaluatedAnnotationsResponse() + ); + client.innerApiCalls.batchImportEvaluatedAnnotations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchImportEvaluatedAnnotations( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchImportEvaluatedAnnotations 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.BatchImportEvaluatedAnnotationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.BatchImportEvaluatedAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchImportEvaluatedAnnotations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchImportEvaluatedAnnotations(request), expectedError); + const actualRequest = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchImportEvaluatedAnnotations 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.BatchImportEvaluatedAnnotationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.BatchImportEvaluatedAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchImportEvaluatedAnnotations(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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('copyModel', () => { + it('invokes copyModel 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.CopyModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CopyModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.copyModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.copyModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.copyModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.copyModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes copyModel 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.CopyModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CopyModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.copyModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.copyModel( + request, + (err?: Error|null, + result?: 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.copyModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.copyModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes copyModel 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.CopyModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CopyModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.copyModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.copyModel(request), expectedError); + const actualRequest = (client.innerApiCalls.copyModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.copyModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes copyModel 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.CopyModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CopyModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.copyModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.copyModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.copyModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.copyModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCopyModelProgress 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.checkCopyModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCopyModelProgress 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.checkCopyModelProgress(''), 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_pipeline_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_pipeline_service_v1beta1.ts new file mode 100644 index 00000000000..1437a1a0889 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_pipeline_service_v1beta1.ts @@ -0,0 +1,4283 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_prediction_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_prediction_service_v1beta1.ts new file mode 100644 index 00000000000..0d93c10f241 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_prediction_service_v1beta1.ts @@ -0,0 +1,2825 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_schedule_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_schedule_service_v1beta1.ts new file mode 100644 index 00000000000..481b0593b40 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_schedule_service_v1beta1.ts @@ -0,0 +1,3668 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 scheduleserviceModule 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.ScheduleServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = scheduleserviceModule.v1beta1.ScheduleServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = scheduleserviceModule.v1beta1.ScheduleServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = scheduleserviceModule.v1beta1.ScheduleServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.scheduleServiceStub, undefined); + await client.initialize(); + assert(client.scheduleServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.scheduleServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.scheduleServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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('createSchedule', () => { + it('invokes createSchedule without error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.CreateScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CreateScheduleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.Schedule() + ); + client.innerApiCalls.createSchedule = stubSimpleCall(expectedResponse); + const [response] = await client.createSchedule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSchedule without error using callback', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.CreateScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CreateScheduleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.Schedule() + ); + client.innerApiCalls.createSchedule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSchedule( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ISchedule|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSchedule with error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.CreateScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CreateScheduleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSchedule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createSchedule(request), expectedError); + const actualRequest = (client.innerApiCalls.createSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSchedule with closed client', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.CreateScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CreateScheduleRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSchedule(request), expectedError); + }); + }); + + describe('getSchedule', () => { + it('invokes getSchedule without error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.GetScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.Schedule() + ); + client.innerApiCalls.getSchedule = stubSimpleCall(expectedResponse); + const [response] = await client.getSchedule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSchedule without error using callback', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.GetScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.Schedule() + ); + client.innerApiCalls.getSchedule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSchedule( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ISchedule|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSchedule with error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.GetScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSchedule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSchedule(request), expectedError); + const actualRequest = (client.innerApiCalls.getSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSchedule with closed client', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.GetScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSchedule(request), expectedError); + }); + }); + + describe('pauseSchedule', () => { + it('invokes pauseSchedule without error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.PauseScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.PauseScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.pauseSchedule = stubSimpleCall(expectedResponse); + const [response] = await client.pauseSchedule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.pauseSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.pauseSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pauseSchedule without error using callback', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.PauseScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.PauseScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.pauseSchedule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pauseSchedule( + 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.pauseSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.pauseSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pauseSchedule with error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.PauseScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.PauseScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.pauseSchedule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.pauseSchedule(request), expectedError); + const actualRequest = (client.innerApiCalls.pauseSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.pauseSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pauseSchedule with closed client', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.PauseScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.PauseScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.pauseSchedule(request), expectedError); + }); + }); + + describe('resumeSchedule', () => { + it('invokes resumeSchedule without error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.resumeSchedule = stubSimpleCall(expectedResponse); + const [response] = await client.resumeSchedule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.resumeSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resumeSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeSchedule without error using callback', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.resumeSchedule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resumeSchedule( + 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.resumeSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resumeSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeSchedule with error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeSchedule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.resumeSchedule(request), expectedError); + const actualRequest = (client.innerApiCalls.resumeSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resumeSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeSchedule with closed client', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.resumeSchedule(request), expectedError); + }); + }); + + describe('deleteSchedule', () => { + it('invokes deleteSchedule without error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.DeleteScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteSchedule = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteSchedule(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchedule without error using callback', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.DeleteScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteSchedule = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSchedule( + request, + (err?: Error|null, + result?: 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.deleteSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchedule with call error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.DeleteScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSchedule = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteSchedule(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchedule with LRO error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.DeleteScheduleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteScheduleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSchedule = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteSchedule(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteSchedule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSchedule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteScheduleProgress without error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteScheduleProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteScheduleProgress with error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteScheduleProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listSchedules', () => { + it('invokes listSchedules without error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListSchedulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListSchedulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), + ]; + client.innerApiCalls.listSchedules = stubSimpleCall(expectedResponse); + const [response] = await client.listSchedules(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSchedules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSchedules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchedules without error using callback', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListSchedulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListSchedulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), + ]; + client.innerApiCalls.listSchedules = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSchedules( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ISchedule[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSchedules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSchedules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchedules with error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListSchedulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListSchedulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSchedules = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSchedules(request), expectedError); + const actualRequest = (client.innerApiCalls.listSchedules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSchedules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchedulesStream without error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListSchedulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListSchedulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), + ]; + client.descriptors.page.listSchedules.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSchedulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Schedule[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Schedule) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listSchedules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSchedules, request)); + assert( + (client.descriptors.page.listSchedules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSchedulesStream with error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListSchedulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListSchedulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSchedules.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSchedulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Schedule[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Schedule) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSchedules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSchedules, request)); + assert( + (client.descriptors.page.listSchedules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSchedules without error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListSchedulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListSchedulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), + ]; + client.descriptors.page.listSchedules.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.ISchedule[] = []; + const iterable = client.listSchedulesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSchedules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSchedules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSchedules with error', async () => { + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListSchedulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListSchedulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSchedules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSchedulesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.ISchedule[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSchedules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSchedules.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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ + 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/google-cloud-aiplatform/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts new file mode 100644 index 00000000000..6057c874a6d --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts @@ -0,0 +1,3656 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_tensorboard_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_tensorboard_service_v1beta1.ts new file mode 100644 index 00000000000..81976b333de --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_tensorboard_service_v1beta1.ts @@ -0,0 +1,6977 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('readTensorboardUsage', () => { + it('invokes readTensorboardUsage 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.ReadTensorboardUsageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ReadTensorboardUsageRequest', ['tensorboard']); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardUsageResponse() + ); + client.innerApiCalls.readTensorboardUsage = stubSimpleCall(expectedResponse); + const [response] = await client.readTensorboardUsage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.readTensorboardUsage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardUsage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readTensorboardUsage 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.ReadTensorboardUsageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ReadTensorboardUsageRequest', ['tensorboard']); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardUsageResponse() + ); + client.innerApiCalls.readTensorboardUsage = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.readTensorboardUsage( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.readTensorboardUsage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardUsage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readTensorboardUsage 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.ReadTensorboardUsageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ReadTensorboardUsageRequest', ['tensorboard']); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.readTensorboardUsage = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.readTensorboardUsage(request), expectedError); + const actualRequest = (client.innerApiCalls.readTensorboardUsage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardUsage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readTensorboardUsage 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.ReadTensorboardUsageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ReadTensorboardUsageRequest', ['tensorboard']); + request.tensorboard = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.readTensorboardUsage(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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_vizier_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_vizier_service_v1beta1.ts new file mode 100644 index 00000000000..44de0467491 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_vizier_service_v1beta1.ts @@ -0,0 +1,4823 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('nasJob', () => { + const fakePath = "/rendered/path/nasJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = "/rendered/path/nasTrialDetail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + nas_job: "nasJobValue", + nas_trial_detail: "nasTrialDetailValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasJobValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, "nasTrialDetailValue"); + assert((client.pathTemplates.nasTrialDetailPathTemplate.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('schedule', () => { + const fakePath = "/rendered/path/schedule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + schedule: "scheduleValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, "scheduleValue"); + assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/tsconfig.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/webpack.config.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/webpack.config.js new file mode 100644 index 00000000000..f4947d41e6b --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/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 a4dcc4f01207f2d92a5872b4533c8a53c7b98721 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 27 Apr 2023 21:22:40 +0000 Subject: [PATCH 2/3] feat: add NVIDIA_L4 to AcceleratorType feat: add experiment and experiment_run to CustomJobSpec feat: add MutateDeployedModel RPC to endpoint_service feat: add GENIE to ModelSourceType feat: add last_scheduled_run_response to Schedule PiperOrigin-RevId: 527640665 Source-Link: https://github.com/googleapis/googleapis/commit/bd7c8fa06dd8171eefc7e7eebe6ab54d0bd28a19 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d897c57f33aa27f17086b617d678d9d7423be44b Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6ImQ4OTdjNTdmMzNhYTI3ZjE3MDg2YjYxN2Q2NzhkOWQ3NDIzYmU0NGIifQ== --- .../aiplatform/v1beta1/accelerator_type.proto | 5 +- .../v1beta1/batch_prediction_job.proto | 4 +- .../cloud/aiplatform/v1beta1/custom_job.proto | 20 ++ .../cloud/aiplatform/v1beta1/dataset.proto | 8 +- .../cloud/aiplatform/v1beta1/endpoint.proto | 10 +- .../aiplatform/v1beta1/endpoint_service.proto | 65 ++++ .../v1beta1/evaluated_annotation.proto | 4 - .../aiplatform/v1beta1/explanation.proto | 29 +- .../cloud/aiplatform/v1beta1/feature.proto | 13 +- .../v1beta1/featurestore_online_service.proto | 2 +- .../v1beta1/featurestore_service.proto | 4 +- .../aiplatform/v1beta1/index_endpoint.proto | 4 +- .../aiplatform/v1beta1/match_service.proto | 4 +- .../cloud/aiplatform/v1beta1/model.proto | 3 + .../aiplatform/v1beta1/model_service.proto | 6 +- .../aiplatform/v1beta1/pipeline_job.proto | 2 +- .../v1beta1/prediction_service.proto | 8 + .../cloud/aiplatform/v1beta1/schedule.proto | 25 +- .../aiplatform/v1beta1/schedule_service.proto | 1 + .../v1beta1/tensorboard_experiment.proto | 14 +- .../v1beta1/tensorboard_service.proto | 13 +- .../endpoint_service.mutate_deployed_model.js | 85 +++++ ...featurestore_service.update_entity_type.js | 2 +- ...eaturestore_service.update_featurestore.js | 2 +- .../v1beta1/match_service.find_neighbors.js | 2 +- .../match_service.read_index_datapoints.js | 2 +- .../model_service.list_model_versions.js | 6 +- ...adata.google.cloud.aiplatform.v1beta1.json | 50 ++- ...ice.export_tensorboard_time_series_data.js | 8 +- .../src/v1beta1/dataset_service_client.ts | 183 +++++++---- ...deployment_resource_pool_service_client.ts | 183 +++++++---- .../src/v1beta1/endpoint_service_client.ts | 307 ++++++++++++++---- .../endpoint_service_client_config.json | 4 + ...turestore_online_serving_service_client.ts | 169 +++++++--- .../v1beta1/featurestore_service_client.ts | 187 +++++++---- .../v1beta1/src/v1beta1/gapic_metadata.json | 10 + .../v1beta1/index_endpoint_service_client.ts | 183 +++++++---- .../src/v1beta1/index_service_client.ts | 183 +++++++---- .../v1beta1/src/v1beta1/job_service_client.ts | 183 +++++++---- .../src/v1beta1/match_service_client.ts | 173 +++++++--- .../src/v1beta1/metadata_service_client.ts | 183 +++++++---- .../src/v1beta1/migration_service_client.ts | 183 +++++++---- .../src/v1beta1/model_service_client.ts | 201 ++++++++---- .../src/v1beta1/pipeline_service_client.ts | 183 +++++++---- .../src/v1beta1/prediction_service_client.ts | 169 +++++++--- .../src/v1beta1/schedule_service_client.ts | 183 +++++++---- .../v1beta1/specialist_pool_service_client.ts | 183 +++++++---- .../src/v1beta1/tensorboard_service_client.ts | 207 ++++++++---- .../src/v1beta1/vizier_service_client.ts | 183 +++++++---- .../test/gapic_dataset_service_v1beta1.ts | 146 ++++++--- ...eployment_resource_pool_service_v1beta1.ts | 146 ++++++--- .../test/gapic_endpoint_service_v1beta1.ts | 300 ++++++++++++++--- ...urestore_online_serving_service_v1beta1.ts | 146 ++++++--- .../gapic_featurestore_service_v1beta1.ts | 146 ++++++--- .../gapic_index_endpoint_service_v1beta1.ts | 146 ++++++--- .../test/gapic_index_service_v1beta1.ts | 146 ++++++--- .../v1beta1/test/gapic_job_service_v1beta1.ts | 146 ++++++--- .../test/gapic_match_service_v1beta1.ts | 146 ++++++--- .../test/gapic_metadata_service_v1beta1.ts | 146 ++++++--- .../test/gapic_migration_service_v1beta1.ts | 146 ++++++--- .../test/gapic_model_service_v1beta1.ts | 146 ++++++--- .../test/gapic_pipeline_service_v1beta1.ts | 146 ++++++--- .../test/gapic_prediction_service_v1beta1.ts | 146 ++++++--- .../test/gapic_schedule_service_v1beta1.ts | 146 ++++++--- .../gapic_specialist_pool_service_v1beta1.ts | 146 ++++++--- .../test/gapic_tensorboard_service_v1beta1.ts | 146 ++++++--- .../test/gapic_vizier_service_v1beta1.ts | 146 ++++++--- 67 files changed, 4662 insertions(+), 1961 deletions(-) create mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto index 92c9b50f345..4e7bf4657eb 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto @@ -47,9 +47,12 @@ enum AcceleratorType { // Nvidia Tesla A100 GPU. NVIDIA_TESLA_A100 = 8; - // Nvidia A2 Ultra GPU. + // Nvidia A100 80GB GPU. NVIDIA_A100_80GB = 9; + // Nvidia L4 GPU. + NVIDIA_L4 = 11; + // TPU v2. TPU_V2 = 6; diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto index 5a98131589b..30e149e6a23 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto @@ -463,9 +463,9 @@ message BatchPredictionJob { // 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, + // Cloud Logging by default. Please note that the logs incur cost, // which are subject to [Cloud Logging - // pricing](https://cloud.google.com/stackdriver/pricing). + // pricing](https://cloud.google.com/logging/pricing). // // User can disable container logging by setting this flag to true. bool disable_container_logging = 34; diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto index dc41de428b9..ea44a6b0c5b 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto @@ -216,6 +216,26 @@ message CustomJobSpec { // (within // [HyperparameterTuningJob.trials][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.trials]). bool enable_dashboard_access = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Experiment associated with this job. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadataStores}/contexts/{experiment-name}` + string experiment = 17 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; + + // Optional. The Experiment Run associated with this job. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadataStores}/contexts/{experiment-name}-{experiment-run-name}` + string experiment_run = 18 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; } // Represents the spec of a worker pool in a job. diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto index 1ae48018638..3e293382e06 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto @@ -90,7 +90,7 @@ message Dataset { map labels = 7; // All SavedQueries belong to the Dataset will be returned in List/Get - // Dataset response. The [annotation_specs][SavedQuery.annotation_specs] field + // Dataset response. The annotation_specs field // will not be populated except for UI cases which will only use // [annotation_spec_count][google.cloud.aiplatform.v1beta1.SavedQuery.annotation_spec_count]. // In CreateDataset request, a SavedQuery is created together if @@ -177,9 +177,9 @@ message ExportDataConfig { ExportFractionSplit fraction_split = 5; } - // 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 + // An expression for filtering what part of the Dataset is to be exported. + // Only Annotations 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto index 6d1c9aef19d..7b787eb9efb 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto @@ -38,6 +38,7 @@ message Endpoint { option (google.api.resource) = { type: "aiplatform.googleapis.com/Endpoint" pattern: "projects/{project}/locations/{location}/endpoints/{endpoint}" + pattern: "projects/{project}/locations/{location}/publishers/{publisher}/models/{model}" }; // Output only. The resource name of the Endpoint. @@ -127,7 +128,8 @@ message Endpoint { // Output only. Resource name of the Model Monitoring job associated with this // Endpoint if monitoring is enabled by - // [CreateModelDeploymentMonitoringJob][]. Format: + // [JobService.CreateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.CreateModelDeploymentMonitoringJob]. + // Format: // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` string model_deployment_monitoring_job = 14 [ (google.api.field_behavior) = OUTPUT_ONLY, @@ -236,17 +238,17 @@ message DeployedModel { string service_account = 11; // If true, the container of the DeployedModel instances will send `stderr` - // and `stdout` streams to Stackdriver Logging. + // and `stdout` streams to Cloud Logging. // // Only supported for custom-trained Models and AutoML Tabular Models. bool enable_container_logging = 12; - // If true, online prediction access logs are sent to StackDriver + // If true, online prediction access logs are sent to Cloud // Logging. // 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 + // Note that 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; diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto index fdf008eb827..f0ed6f97940 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto @@ -122,6 +122,24 @@ service EndpointService { metadata_type: "UndeployModelOperationMetadata" }; } + + // Updates an existing deployed model. Updatable fields include + // `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, + // `disable_container_logging` (v1 only), and `enable_container_logging` + // (v1beta1 only). + rpc MutateDeployedModel(MutateDeployedModelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:mutateDeployedModel" + body: "*" + }; + option (google.api.method_signature) = + "endpoint,deployed_model,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "MutateDeployedModelResponse" + metadata_type: "MutateDeployedModelOperationMetadata" + }; + } } // Request message for @@ -348,3 +366,50 @@ message UndeployModelOperationMetadata { // The operation generic information. GenericOperationMetadata generic_metadata = 1; } + +// Request message for +// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModel]. +message MutateDeployedModelRequest { + // Required. The name of the Endpoint resource into which to mutate a + // DeployedModel. 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 mutated within the Endpoint. Only the + // following fields can be mutated: + // + // * `min_replica_count` in either + // [DedicatedResources][google.cloud.aiplatform.v1beta1.DedicatedResources] or + // [AutomaticResources][google.cloud.aiplatform.v1beta1.AutomaticResources] + // * `max_replica_count` in either + // [DedicatedResources][google.cloud.aiplatform.v1beta1.DedicatedResources] or + // [AutomaticResources][google.cloud.aiplatform.v1beta1.AutomaticResources] + // * [autoscaling_metric_specs][google.cloud.aiplatform.v1beta1.DedicatedResources.autoscaling_metric_specs] + // * `disable_container_logging` (v1 only) + // * `enable_container_logging` (v1beta1 only) + DeployedModel deployed_model = 2 [(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 = 4 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for +// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModel]. +message MutateDeployedModelResponse { + // The DeployedModel that's being mutated. + DeployedModel deployed_model = 1; +} + +// Runtime operation information for +// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModel]. +message MutateDeployedModelOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto index 6e68912c0f4..239b55cdb6b 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto @@ -103,10 +103,6 @@ message EvaluatedAnnotation { // ModelEvaluation. The EvaluatedDataItemView consists of all ground truths // and predictions on // [data_item_payload][google.cloud.aiplatform.v1beta1.EvaluatedAnnotation.data_item_payload]. - // - // Can be passed in - // [GetEvaluatedDataItemView's][ModelService.GetEvaluatedDataItemView][] - // [id][GetEvaluatedDataItemViewRequest.id]. string evaluated_data_item_view_id = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto index 29ee96a7b94..6a0e8bfab31 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto @@ -426,20 +426,22 @@ message BlurBaselineConfig { // 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. + // The full configuration for the generated index, the semantics are the + // same as [metadata][google.cloud.aiplatform.v1beta1.Index.metadata] and + // should match + // [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config). google.protobuf.Value nearest_neighbor_search_config = 2; - // Preset config based on the desired query speed-precision trade-off - // and modality + // Simplified preset configuration, which automatically sets configuration + // values based on the desired query speed-precision trade-off and modality. Presets presets = 4; } - // The Cloud Storage location for the input instances. + // The Cloud Storage locations that contain the instances to be + // indexed for approximate nearest neighbor search. GcsSource gcs_source = 1; - // The number of neighbors to return. + // The number of neighbors to return when querying for examples. int32 neighbor_count = 3; } @@ -448,7 +450,6 @@ 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. @@ -470,10 +471,14 @@ message Presets { TABULAR = 3; } - // Preset option controlling parameters for query speed-precision trade-off + // Preset option controlling parameters for speed-precision trade-off when + // querying for examples. If omitted, defaults to `PRECISE`. optional Query query = 1; - // Preset option controlling parameters for different modalities + // The modality of the uploaded model, which automatically configures the + // distance measurement and feature normalization for the underlying example + // index and queries. If your model does not precisely fit one of these types, + // it is okay to choose the closest type. Modality modality = 2; } @@ -482,8 +487,8 @@ message Presets { // 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. + // attribution 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. diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto index 4ac111e5f72..c37b23c9ed8 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto @@ -39,10 +39,11 @@ message 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 + // A list of historical + // [SnapshotAnalysis][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis] + // or + // [ImportFeaturesAnalysis][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.ImportFeaturesAnalysis] + // stats requested by user, sorted by // [FeatureStatsAnomaly.start_time][google.cloud.aiplatform.v1beta1.FeatureStatsAnomaly.start_time] // descending. message MonitoringStatsAnomaly { @@ -170,8 +171,8 @@ message Feature { // config on EntityType. bool disable_monitoring = 12 [(google.api.field_behavior) = OPTIONAL]; - // Output only. A list of historical [Snapshot - // Analysis][FeaturestoreMonitoringConfig.SnapshotAnalysis] + // Output only. A list of historical + // [SnapshotAnalysis][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis] // stats requested by user, sorted by // [FeatureStatsAnomaly.start_time][google.cloud.aiplatform.v1beta1.FeatureStatsAnomaly.start_time] // descending. diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto index af6182b2d56..5c26efb6f16 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto @@ -162,7 +162,7 @@ message ReadFeatureValuesResponse { }]; // List of Feature metadata corresponding to each piece of - // [ReadFeatureValuesResponse.data][]. + // [ReadFeatureValuesResponse.EntityView.data][google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse.EntityView.data]. repeated FeatureDescriptor feature_descriptors = 2; } diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto index 5efd213643f..f4ec90768c2 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto @@ -464,7 +464,7 @@ message UpdateFeaturestoreRequest { // * `labels` // * `online_serving_config.fixed_node_count` // * `online_serving_config.scaling` - // * `online_storage_ttl_days` (available in Preview) + // * `online_storage_ttl_days` google.protobuf.FieldMask update_mask = 2; } @@ -927,7 +927,7 @@ message UpdateEntityTypeRequest { // * `monitoring_config.import_features_analysis.anomaly_detection_baseline` // * `monitoring_config.numerical_threshold_config.value` // * `monitoring_config.categorical_threshold_config.value` - // * `offline_storage_ttl_days` (available in Preview) + // * `offline_storage_ttl_days` google.protobuf.FieldMask update_mask = 2; } diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto index 9d1c55ec7be..ef2efb41c65 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto @@ -205,13 +205,13 @@ message DeployedIndex { DedicatedResources dedicated_resources = 16 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If true, private endpoint's access logs are sent to StackDriver + // Optional. If true, private endpoint's access logs are sent to Cloud // 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 + // Note that 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]; diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/match_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/match_service.proto index 07acb17b08f..88f1ba11b45 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/match_service.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/match_service.proto @@ -102,7 +102,7 @@ message FindNeighborsRequest { } ]; - // The ID of the DeploydIndex that will serve the request. This request is + // The ID of the DeployedIndex that will serve the request. This request is // sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That // IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index // has a DeployedIndex.id field. @@ -161,7 +161,7 @@ message ReadIndexDatapointsRequest { } ]; - // The ID of the DeploydIndex that will serve the request. + // The ID of the DeployedIndex that will serve the request. string deployed_index_id = 2; // IDs of the datapoints to be searched for. diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto index 3dd24837ff2..6293bfa22f4 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto @@ -712,6 +712,9 @@ message ModelSourceInfo { // The Model is saved or tuned from Model Garden. MODEL_GARDEN = 4; + + // The Model is saved or tuned from Genie. + GENIE = 5; } // Type of the model source. diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto index 5a766d0e834..49eaee8e2cb 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto @@ -410,8 +410,10 @@ message ListModelVersionsRequest { // 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. + // [next_page_token][google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token] + // of the previous + // [ListModelVersions][google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions] + // call. string page_token = 3; // An expression for filtering the results of the request. For field names diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto index 8878c8bdfbf..75171c649f2 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto @@ -293,7 +293,7 @@ message PipelineTaskDetail { 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][]. + // [pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_spec]. string task_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Task create time. diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto index 2a07c70d22b..b6d2c16ffb8 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto @@ -43,6 +43,10 @@ service PredictionService { option (google.api.http) = { post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:predict" body: "*" + additional_bindings { + post: "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:predict" + body: "*" + } }; option (google.api.method_signature) = "endpoint,instances,parameters"; } @@ -62,6 +66,10 @@ service PredictionService { option (google.api.http) = { post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:rawPredict" body: "*" + additional_bindings { + post: "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:rawPredict" + body: "*" + } }; option (google.api.method_signature) = "endpoint,http_body"; } diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule.proto index 14113392316..ad02ad01d2b 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule.proto @@ -37,6 +37,15 @@ message Schedule { pattern: "projects/{project}/locations/{location}/schedules/{schedule}" }; + // Status of a scheduled run. + message RunResponse { + // The scheduled run time based on the user-specified schedule. + google.protobuf.Timestamp scheduled_run_time = 1; + + // The response of the scheduled run. + string run_response = 2; + } + // Possible state of the schedule. enum State { // Unspecified. @@ -119,6 +128,10 @@ message Schedule { google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Timestamp when this Schedule was updated. + google.protobuf.Timestamp update_time = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Timestamp when this Schedule should schedule the next run. // Having a next_run_time in the past means the runs are being started // behind schedule. @@ -135,8 +148,9 @@ message Schedule { google.protobuf.Timestamp last_resume_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Required. Maximum number of runs that can be executed concurrently for this - // Schedule. + // Required. Maximum number of runs that can be started concurrently for this + // Schedule. This is the limit for starting the scheduled requests and not the + // execution of the operations/jobs created by the requests (if applicable). int64 max_concurrent_run_count = 11 [(google.api.field_behavior) = REQUIRED]; // Optional. Whether new scheduled runs can be queued when max_concurrent_runs @@ -148,4 +162,11 @@ message Schedule { // from PAUSED state. If set to true, all missed runs will be scheduled. New // runs will be scheduled after the backfill is complete. Default to false. bool catch_up = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Response of the last scheduled run. + // This is the response for starting the scheduled requests and not the + // execution of the operations/jobs created by the requests (if applicable). + // Unset if no run has been scheduled yet. + RunResponse last_scheduled_run_response = 18 + [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule_service.proto index 74bebf386ca..234dcece3c2 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule_service.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule_service.proto @@ -104,6 +104,7 @@ service ScheduleService { body: "*" }; option (google.api.method_signature) = "name"; + option (google.api.method_signature) = "name,catch_up"; } } diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto index b9801bf6452..c29f2f17b6a 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto @@ -57,18 +57,20 @@ message TensorboardExperiment { // The labels with user-defined metadata to organize your Datasets. // - // Label keys and values can be no longer than 64 characters + // Label keys and values cannot be 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. + // System reserved label keys are prefixed with `aiplatform.googleapis.com/` + // and are immutable. The 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 = 6; // Used to perform consistent read-modify-write updates. If not set, a blind diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto index 0332db5dd4a..df9799cc9c5 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto @@ -1092,12 +1092,12 @@ message ExportTensorboardTimeSeriesDataRequest { int32 page_size = 3; // A page token, received from a previous - // [TensorboardService.ExportTensorboardTimeSeries][] call. - // Provide this to retrieve the subsequent page. + // [ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData] + // 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. + // [ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData] + // must match the call that provided the page token. string page_token = 4; // Field to use to sort the TensorboardTimeSeries' data. @@ -1113,8 +1113,9 @@ message ExportTensorboardTimeSeriesDataResponse { 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. + // [page_token][google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest.page_token] + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. string next_page_token = 2; } diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js new file mode 100644 index 00000000000..d14f0f1fea9 --- /dev/null +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js @@ -0,0 +1,85 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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'; + +function main(endpoint, deployedModel, updateMask) { + // [START aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Endpoint resource into which to mutate a + * DeployedModel. Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + */ + // const endpoint = 'abc123' + /** + * Required. The DeployedModel to be mutated within the Endpoint. Only the + * following fields can be mutated: + * * `min_replica_count` in either + * DedicatedResources google.cloud.aiplatform.v1beta1.DedicatedResources or + * AutomaticResources google.cloud.aiplatform.v1beta1.AutomaticResources + * * `max_replica_count` in either + * DedicatedResources google.cloud.aiplatform.v1beta1.DedicatedResources or + * AutomaticResources google.cloud.aiplatform.v1beta1.AutomaticResources + * * autoscaling_metric_specs google.cloud.aiplatform.v1beta1.DedicatedResources.autoscaling_metric_specs + * * `disable_container_logging` (v1 only) + * * `enable_container_logging` (v1beta1 only) + */ + // const deployedModel = {} + /** + * Required. The update mask applies to the resource. See + * google.protobuf.FieldMask google.protobuf.FieldMask. + */ + // const updateMask = {} + + // Imports the Aiplatform library + const {EndpointServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new EndpointServiceClient(); + + async function callMutateDeployedModel() { + // Construct request + const request = { + endpoint, + deployedModel, + updateMask, + }; + + // Run request + const [operation] = await aiplatformClient.mutateDeployedModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callMutateDeployedModel(); + // [END aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.update_entity_type.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.update_entity_type.js index c44781a7d36..a5503fa556f 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.update_entity_type.js +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.update_entity_type.js @@ -52,7 +52,7 @@ function main(entityType) { * * `monitoring_config.import_features_analysis.anomaly_detection_baseline` * * `monitoring_config.numerical_threshold_config.value` * * `monitoring_config.categorical_threshold_config.value` - * * `offline_storage_ttl_days` (available in Preview) + * * `offline_storage_ttl_days` */ // const updateMask = {} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.update_featurestore.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.update_featurestore.js index 00871b21570..ba70ae7a4b9 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.update_featurestore.js +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.update_featurestore.js @@ -46,7 +46,7 @@ function main(featurestore) { * * `labels` * * `online_serving_config.fixed_node_count` * * `online_serving_config.scaling` - * * `online_storage_ttl_days` (available in Preview) + * * `online_storage_ttl_days` */ // const updateMask = {} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/match_service.find_neighbors.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/match_service.find_neighbors.js index a59431e2e8d..4de8b881880 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/match_service.find_neighbors.js +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/match_service.find_neighbors.js @@ -35,7 +35,7 @@ function main(indexEndpoint) { */ // const indexEndpoint = 'abc123' /** - * The ID of the DeploydIndex that will serve the request. This request is + * The ID of the DeployedIndex that will serve the request. This request is * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index * has a DeployedIndex.id field. diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/match_service.read_index_datapoints.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/match_service.read_index_datapoints.js index 0b8bd4d4fc6..2ca65a32959 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/match_service.read_index_datapoints.js +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/match_service.read_index_datapoints.js @@ -35,7 +35,7 @@ function main(indexEndpoint) { */ // const indexEndpoint = 'abc123' /** - * The ID of the DeploydIndex that will serve the request. + * The ID of the DeployedIndex that will serve the request. */ // const deployedIndexId = 'abc123' /** diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.list_model_versions.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.list_model_versions.js index c39d7342c70..10f0e2d46c7 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.list_model_versions.js +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.list_model_versions.js @@ -39,8 +39,10 @@ function main(name) { /** * 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. + * next_page_token google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token + * of the previous + * ListModelVersions google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions + * call. */ // const pageToken = 'abc123' /** diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json index 2e6db332e86..6af87dd241b 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json @@ -1191,6 +1191,54 @@ } } }, + { + "regionTag": "aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_async", + "title": "DatasetService mutateDeployedModel Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing deployed model. Updatable fields include `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, `disable_container_logging` (v1 only), and `enable_container_logging` (v1beta1 only).", + "canonical": true, + "file": "endpoint_service.mutate_deployed_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MutateDeployedModel", + "fullName": "google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModel", + "async": true, + "parameters": [ + { + "name": "endpoint", + "type": "TYPE_STRING" + }, + { + "name": "deployed_model", + "type": ".google.cloud.aiplatform.v1beta1.DeployedModel" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EndpointServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.EndpointServiceClient" + }, + "method": { + "shortName": "MutateDeployedModel", + "fullName": "google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModel", + "service": { + "shortName": "EndpointService", + "fullName": "google.cloud.aiplatform.v1beta1.EndpointService" + } + } + } + }, { "regionTag": "aiplatform_v1beta1_generated_FeaturestoreOnlineServingService_ReadFeatureValues_async", "title": "DatasetService readFeatureValues Sample", @@ -6462,7 +6510,7 @@ "segments": [ { "start": 25, - "end": 90, + "end": 92, "type": "FULL" } ], diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.js index 2b0d787398c..7aa7c25d623 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.js +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.js @@ -46,11 +46,11 @@ function main(tensorboardTimeSeries) { // const pageSize = 1234 /** * A page token, received from a previous - * TensorboardService.ExportTensorboardTimeSeries call. - * Provide this to retrieve the subsequent page. + * ExportTensorboardTimeSeriesData google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData + * 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. + * ExportTensorboardTimeSeriesData google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData + * must match the call that provided the page token. */ // const pageToken = 'abc123' /** diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_client.ts index 9dbf1373ddc..9aa88c73c7f 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_client.ts @@ -204,9 +204,6 @@ export class DatasetServiceClient { 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}' ), @@ -258,6 +255,12 @@ export class DatasetServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -318,14 +321,14 @@ export class DatasetServiceClient { 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',}], + },{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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',}], + },{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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); @@ -3261,55 +3264,6 @@ export class DatasetServiceClient { 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. * @@ -4247,6 +4201,117 @@ export class DatasetServiceClient { return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client.ts index b531629f15b..29c702896ca 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client.ts @@ -203,9 +203,6 @@ export class DeploymentResourcePoolServiceClient { 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}' ), @@ -260,6 +257,12 @@ export class DeploymentResourcePoolServiceClient { projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -314,14 +317,14 @@ export class DeploymentResourcePoolServiceClient { 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',}], + },{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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',}], + },{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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); @@ -2099,55 +2102,6 @@ export class DeploymentResourcePoolServiceClient { 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. * @@ -3108,6 +3062,117 @@ export class DeploymentResourcePoolServiceClient { return this.pathTemplates.projectPathTemplate.match(projectName).project; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client.ts index 60505b3ff92..db12134ab2c 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client.ts @@ -203,9 +203,6 @@ export class EndpointServiceClient { 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}' ), @@ -257,6 +254,12 @@ export class EndpointServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -309,14 +312,14 @@ export class EndpointServiceClient { 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',}], + },{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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',}], + },{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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); @@ -336,6 +339,10 @@ export class EndpointServiceClient { '.google.cloud.aiplatform.v1beta1.UndeployModelResponse') as gax.protobuf.Type; const undeployModelMetadata = protoFilesRoot.lookup( '.google.cloud.aiplatform.v1beta1.UndeployModelOperationMetadata') as gax.protobuf.Type; + const mutateDeployedModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse') as gax.protobuf.Type; + const mutateDeployedModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata') as gax.protobuf.Type; this.descriptors.longrunning = { createEndpoint: new this._gaxModule.LongrunningDescriptor( @@ -353,7 +360,11 @@ export class EndpointServiceClient { undeployModel: new this._gaxModule.LongrunningDescriptor( this.operationsClient, undeployModelResponse.decode.bind(undeployModelResponse), - undeployModelMetadata.decode.bind(undeployModelMetadata)) + undeployModelMetadata.decode.bind(undeployModelMetadata)), + mutateDeployedModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + mutateDeployedModelResponse.decode.bind(mutateDeployedModelResponse), + mutateDeployedModelMetadata.decode.bind(mutateDeployedModelMetadata)) }; // Put together the default options sent with requests. @@ -399,7 +410,7 @@ export class EndpointServiceClient { // 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']; + ['createEndpoint', 'getEndpoint', 'listEndpoints', 'updateEndpoint', 'deleteEndpoint', 'deployModel', 'undeployModel', 'mutateDeployedModel']; for (const methodName of endpointServiceStubMethods) { const callPromise = this.endpointServiceStub.then( stub => (...args: Array<{}>) => { @@ -1051,6 +1062,118 @@ export class EndpointServiceClient { const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeployModel, this._gaxModule.createDefaultBackoffSettings()); return decodeOperation as LROperation; } +/** + * Updates an existing deployed model. Updatable fields include + * `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, + * `disable_container_logging` (v1 only), and `enable_container_logging` + * (v1beta1 only). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.endpoint + * Required. The name of the Endpoint resource into which to mutate a + * DeployedModel. Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {google.cloud.aiplatform.v1beta1.DeployedModel} request.deployedModel + * Required. The DeployedModel to be mutated within the Endpoint. Only the + * following fields can be mutated: + * + * * `min_replica_count` in either + * {@link google.cloud.aiplatform.v1beta1.DedicatedResources|DedicatedResources} or + * {@link google.cloud.aiplatform.v1beta1.AutomaticResources|AutomaticResources} + * * `max_replica_count` in either + * {@link google.cloud.aiplatform.v1beta1.DedicatedResources|DedicatedResources} or + * {@link google.cloud.aiplatform.v1beta1.AutomaticResources|AutomaticResources} + * * {@link google.cloud.aiplatform.v1beta1.DedicatedResources.autoscaling_metric_specs|autoscaling_metric_specs} + * * `disable_container_logging` (v1 only) + * * `enable_container_logging` (v1beta1 only) + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://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_MutateDeployedModel_async + */ + mutateDeployedModel( + request?: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + mutateDeployedModel( + request: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + mutateDeployedModel( + request: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + mutateDeployedModel( + request?: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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.mutateDeployedModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `mutateDeployedModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://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_MutateDeployedModel_async + */ + async checkMutateDeployedModelProgress(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.mutateDeployedModel, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } /** * Lists Endpoints in a Location. * @@ -2266,55 +2389,6 @@ export class EndpointServiceClient { 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. * @@ -3252,6 +3326,117 @@ export class EndpointServiceClient { return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client_config.json index 4775abb5f33..25b4f7170d1 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client_config.json +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client_config.json @@ -54,6 +54,10 @@ "timeout_millis": 5000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "MutateDeployedModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts index 7c351b6044e..43772b8f8e1 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts @@ -202,9 +202,6 @@ export class FeaturestoreOnlineServingServiceClient { 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}' ), @@ -253,6 +250,12 @@ export class FeaturestoreOnlineServingServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -1432,55 +1435,6 @@ export class FeaturestoreOnlineServingServiceClient { 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. * @@ -2382,6 +2336,117 @@ export class FeaturestoreOnlineServingServiceClient { return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client.ts index ad0d1282c2a..2ec04da1b0f 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client.ts @@ -203,9 +203,6 @@ export class FeaturestoreServiceClient { 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}' ), @@ -260,6 +257,12 @@ export class FeaturestoreServiceClient { projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -318,14 +321,14 @@ export class FeaturestoreServiceClient { 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',}], + },{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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',}], + },{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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); @@ -730,7 +733,7 @@ export class FeaturestoreServiceClient { * * `monitoring_config.import_features_analysis.anomaly_detection_baseline` * * `monitoring_config.numerical_threshold_config.value` * * `monitoring_config.categorical_threshold_config.value` - * * `offline_storage_ttl_days` (available in Preview) + * * `offline_storage_ttl_days` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1083,7 +1086,7 @@ export class FeaturestoreServiceClient { * * `labels` * * `online_serving_config.fixed_node_count` * * `online_serving_config.scaling` - * * `online_storage_ttl_days` (available in Preview) + * * `online_storage_ttl_days` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -4524,55 +4527,6 @@ export class FeaturestoreServiceClient { 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. * @@ -5533,6 +5487,117 @@ export class FeaturestoreServiceClient { return this.pathTemplates.projectPathTemplate.match(projectName).project; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/gapic_metadata.json index 283ed5b2e87..a2478c9f558 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/gapic_metadata.json +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/gapic_metadata.json @@ -266,6 +266,11 @@ "undeployModel" ] }, + "MutateDeployedModel": { + "methods": [ + "mutateDeployedModel" + ] + }, "ListEndpoints": { "methods": [ "listEndpoints", @@ -308,6 +313,11 @@ "undeployModel" ] }, + "MutateDeployedModel": { + "methods": [ + "mutateDeployedModel" + ] + }, "ListEndpoints": { "methods": [ "listEndpoints", diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client.ts index 1d878959242..df50376b489 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client.ts @@ -203,9 +203,6 @@ export class IndexEndpointServiceClient { 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}' ), @@ -257,6 +254,12 @@ export class IndexEndpointServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -309,14 +312,14 @@ export class IndexEndpointServiceClient { 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',}], + },{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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',}], + },{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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); @@ -2339,55 +2342,6 @@ export class IndexEndpointServiceClient { 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. * @@ -3325,6 +3279,117 @@ export class IndexEndpointServiceClient { return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client.ts index 10914fdaf07..88c3c8a0c28 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client.ts @@ -203,9 +203,6 @@ export class IndexServiceClient { 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}' ), @@ -257,6 +254,12 @@ export class IndexServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -309,14 +312,14 @@ export class IndexServiceClient { 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',}], + },{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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',}], + },{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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); @@ -2155,55 +2158,6 @@ export class IndexServiceClient { 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. * @@ -3141,6 +3095,117 @@ export class IndexServiceClient { return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client.ts index 7a8c10038dc..6bc5468f08a 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client.ts @@ -203,9 +203,6 @@ export class JobServiceClient { 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}' ), @@ -257,6 +254,12 @@ export class JobServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -323,14 +326,14 @@ export class JobServiceClient { 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',}], + },{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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',}], + },{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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); @@ -5676,55 +5679,6 @@ export class JobServiceClient { 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. * @@ -6662,6 +6616,117 @@ export class JobServiceClient { return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client.ts index d24e594f7ae..343ca9a9cf7 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client.ts @@ -203,9 +203,6 @@ export class MatchServiceClient { 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}' ), @@ -254,6 +251,12 @@ export class MatchServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -422,7 +425,7 @@ export class MatchServiceClient { * Format: * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` * @param {string} request.deployedIndexId - * The ID of the DeploydIndex that will serve the request. This request is + * The ID of the DeployedIndex that will serve the request. This request is * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index * has a DeployedIndex.id field. @@ -510,7 +513,7 @@ export class MatchServiceClient { * Format: * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` * @param {string} request.deployedIndexId - * The ID of the DeploydIndex that will serve the request. + * The ID of the DeployedIndex that will serve the request. * @param {string[]} request.ids * IDs of the datapoints to be searched for. * @param {object} [options] @@ -1370,55 +1373,6 @@ export class MatchServiceClient { 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. * @@ -2320,6 +2274,117 @@ export class MatchServiceClient { return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client.ts index 955ba5e0812..c46c4cd81b9 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client.ts @@ -203,9 +203,6 @@ export class MetadataServiceClient { 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}' ), @@ -260,6 +257,12 @@ export class MetadataServiceClient { projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -320,14 +323,14 @@ export class MetadataServiceClient { 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',}], + },{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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',}], + },{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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); @@ -5167,55 +5170,6 @@ export class MetadataServiceClient { 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. * @@ -6176,6 +6130,117 @@ export class MetadataServiceClient { return this.pathTemplates.projectPathTemplate.match(projectName).project; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client.ts index 43c798494c0..2c2d8cc6e1a 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client.ts @@ -204,9 +204,6 @@ export class MigrationServiceClient { 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}' ), @@ -258,6 +255,12 @@ export class MigrationServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -310,14 +313,14 @@ export class MigrationServiceClient { 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',}], + },{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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',}], + },{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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); @@ -1755,55 +1758,6 @@ export class MigrationServiceClient { 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. * @@ -2741,6 +2695,117 @@ export class MigrationServiceClient { return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client.ts index f0db2e9d90a..71e91035504 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client.ts @@ -203,9 +203,6 @@ export class ModelServiceClient { 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}' ), @@ -257,6 +254,12 @@ export class ModelServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -315,14 +318,14 @@ export class ModelServiceClient { 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',}], + },{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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',}], + },{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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); @@ -2017,8 +2020,10 @@ export class ModelServiceClient { * @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. + * {@link google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token|next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions|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. @@ -2123,8 +2128,10 @@ export class ModelServiceClient { * @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. + * {@link google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token|next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions|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. @@ -2196,8 +2203,10 @@ export class ModelServiceClient { * @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. + * {@link google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token|next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions|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. @@ -3638,55 +3647,6 @@ export class ModelServiceClient { 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. * @@ -4624,6 +4584,117 @@ export class ModelServiceClient { return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client.ts index 082c049c875..0070d2fd0b8 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client.ts @@ -205,9 +205,6 @@ export class PipelineServiceClient { 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}' ), @@ -259,6 +256,12 @@ export class PipelineServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -313,14 +316,14 @@ export class PipelineServiceClient { 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',}], + },{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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',}], + },{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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); @@ -2703,55 +2706,6 @@ export class PipelineServiceClient { 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. * @@ -3689,6 +3643,117 @@ export class PipelineServiceClient { return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client.ts index d405d8d6234..4237e832399 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client.ts @@ -202,9 +202,6 @@ export class PredictionServiceClient { 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}' ), @@ -253,6 +250,12 @@ export class PredictionServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -1507,55 +1510,6 @@ export class PredictionServiceClient { 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. * @@ -2457,6 +2411,117 @@ export class PredictionServiceClient { return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client.ts index d7a7ea7f505..5706d059cf7 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client.ts @@ -204,9 +204,6 @@ export class ScheduleServiceClient { 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}' ), @@ -258,6 +255,12 @@ export class ScheduleServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -310,14 +313,14 @@ export class ScheduleServiceClient { 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',}], + },{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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',}], + },{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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); @@ -2169,55 +2172,6 @@ export class ScheduleServiceClient { 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. * @@ -3155,6 +3109,117 @@ export class ScheduleServiceClient { return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client.ts index 2289dedea89..aa6b1c1685f 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client.ts @@ -208,9 +208,6 @@ export class SpecialistPoolServiceClient { 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}' ), @@ -262,6 +259,12 @@ export class SpecialistPoolServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -314,14 +317,14 @@ export class SpecialistPoolServiceClient { 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',}], + },{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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',}], + },{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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); @@ -2002,55 +2005,6 @@ export class SpecialistPoolServiceClient { 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. * @@ -2988,6 +2942,117 @@ export class SpecialistPoolServiceClient { return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client.ts index 6aabfb4564d..02588abe1df 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client.ts @@ -203,9 +203,6 @@ export class TensorboardServiceClient { 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}' ), @@ -260,6 +257,12 @@ export class TensorboardServiceClient { projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -326,14 +329,14 @@ export class TensorboardServiceClient { 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',}], + },{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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',}], + },{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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); @@ -3378,12 +3381,12 @@ export class TensorboardServiceClient { * Values above 10000 are 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. + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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. + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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 is returned in a pseudo random @@ -3474,12 +3477,12 @@ export class TensorboardServiceClient { * Values above 10000 are 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. + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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. + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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 is returned in a pseudo random @@ -3537,12 +3540,12 @@ export class TensorboardServiceClient { * Values above 10000 are 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. + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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. + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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 is returned in a pseudo random @@ -4549,55 +4552,6 @@ export class TensorboardServiceClient { 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. * @@ -5558,6 +5512,117 @@ export class TensorboardServiceClient { return this.pathTemplates.projectPathTemplate.match(projectName).project; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client.ts index 72fb92f614e..93827f38ffe 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client.ts @@ -207,9 +207,6 @@ export class VizierServiceClient { 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}' ), @@ -261,6 +258,12 @@ export class VizierServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -315,14 +318,14 @@ export class VizierServiceClient { 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',}], + },{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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',}], + },{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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait',}], }]; } this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); @@ -2826,55 +2829,6 @@ export class VizierServiceClient { 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. * @@ -3812,6 +3766,117 @@ export class VizierServiceClient { return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_dataset_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_dataset_service_v1beta1.ts index 68e5a05b222..89f1ea74d25 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_dataset_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_dataset_service_v1beta1.ts @@ -3587,52 +3587,6 @@ describe('v1beta1.DatasetServiceClient', () => { }); }); - 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 = { @@ -4479,6 +4433,106 @@ describe('v1beta1.DatasetServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_deployment_resource_pool_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_deployment_resource_pool_service_v1beta1.ts index 99427c088ec..8105616de05 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_deployment_resource_pool_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_deployment_resource_pool_service_v1beta1.ts @@ -2324,52 +2324,6 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { }); }); - 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 = { @@ -3246,6 +3200,106 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_endpoint_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_endpoint_service_v1beta1.ts index d106d1a80ee..f1bac393e28 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_endpoint_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_endpoint_service_v1beta1.ts @@ -1047,6 +1047,160 @@ describe('v1beta1.EndpointServiceClient', () => { }); }); + describe('mutateDeployedModel', () => { + it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.mutateDeployedModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.mutateDeployedModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.mutateDeployedModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.mutateDeployedModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.mutateDeployedModel( + request, + (err?: Error|null, + result?: 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.mutateDeployedModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateDeployedModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.mutateDeployedModel(request), expectedError); + const actualRequest = (client.innerApiCalls.mutateDeployedModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateDeployedModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.mutateDeployedModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.mutateDeployedModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkMutateDeployedModelProgress 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.checkMutateDeployedModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkMutateDeployedModelProgress 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.checkMutateDeployedModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + describe('listEndpoints', () => { it('invokes listEndpoints without error', async () => { const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ @@ -2499,52 +2653,6 @@ describe('v1beta1.EndpointServiceClient', () => { }); }); - 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 = { @@ -3391,6 +3499,106 @@ describe('v1beta1.EndpointServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts index 1fe783a3462..88d7edd6d2d 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts @@ -1447,52 +1447,6 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { }); }); - 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 = { @@ -2301,6 +2255,106 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_service_v1beta1.ts index 40442e1b56b..45dde10588a 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_service_v1beta1.ts @@ -4798,52 +4798,6 @@ describe('v1beta1.FeaturestoreServiceClient', () => { }); }); - 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 = { @@ -5720,6 +5674,106 @@ describe('v1beta1.FeaturestoreServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts index 8b5109064ea..ed60c31ce21 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts @@ -2653,52 +2653,6 @@ describe('v1beta1.IndexEndpointServiceClient', () => { }); }); - 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 = { @@ -3545,6 +3499,106 @@ describe('v1beta1.IndexEndpointServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_service_v1beta1.ts index a64c07e1eb7..4bc862ad739 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_service_v1beta1.ts @@ -2453,52 +2453,6 @@ describe('v1beta1.IndexServiceClient', () => { }); }); - 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 = { @@ -3345,6 +3299,106 @@ describe('v1beta1.IndexServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_job_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_job_service_v1beta1.ts index fa8f7a6d761..dec47164817 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_job_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_job_service_v1beta1.ts @@ -6620,52 +6620,6 @@ describe('v1beta1.JobServiceClient', () => { }); }); - 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 = { @@ -7512,6 +7466,106 @@ describe('v1beta1.JobServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_match_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_match_service_v1beta1.ts index c5d4bf8d47e..15a2065ecbf 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_match_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_match_service_v1beta1.ts @@ -1336,52 +1336,6 @@ describe('v1beta1.MatchServiceClient', () => { }); }); - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - 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 = { @@ -2190,6 +2144,106 @@ describe('v1beta1.MatchServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_metadata_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_metadata_service_v1beta1.ts index abe03e18ea6..00b86b1c760 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_metadata_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_metadata_service_v1beta1.ts @@ -5939,52 +5939,6 @@ describe('v1beta1.MetadataServiceClient', () => { }); }); - 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 = { @@ -6861,6 +6815,106 @@ describe('v1beta1.MetadataServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_migration_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_migration_service_v1beta1.ts index 34f6e810959..928a20c8a83 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_migration_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_migration_service_v1beta1.ts @@ -1817,52 +1817,6 @@ describe('v1beta1.MigrationServiceClient', () => { }); }); - 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 = { @@ -2709,6 +2663,106 @@ describe('v1beta1.MigrationServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_model_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_model_service_v1beta1.ts index bf8333d4144..2d1707f2c62 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_model_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_model_service_v1beta1.ts @@ -4190,52 +4190,6 @@ describe('v1beta1.ModelServiceClient', () => { }); }); - 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 = { @@ -5082,6 +5036,106 @@ describe('v1beta1.ModelServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_pipeline_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_pipeline_service_v1beta1.ts index 1437a1a0889..350e4356392 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_pipeline_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_pipeline_service_v1beta1.ts @@ -2864,52 +2864,6 @@ describe('v1beta1.PipelineServiceClient', () => { }); }); - 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 = { @@ -3756,6 +3710,106 @@ describe('v1beta1.PipelineServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_prediction_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_prediction_service_v1beta1.ts index 0d93c10f241..407695154a2 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_prediction_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_prediction_service_v1beta1.ts @@ -1444,52 +1444,6 @@ describe('v1beta1.PredictionServiceClient', () => { }); }); - 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 = { @@ -2298,6 +2252,106 @@ describe('v1beta1.PredictionServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_schedule_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_schedule_service_v1beta1.ts index 481b0593b40..711c6949928 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_schedule_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_schedule_service_v1beta1.ts @@ -2249,52 +2249,6 @@ describe('v1beta1.ScheduleServiceClient', () => { }); }); - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 = { @@ -3141,6 +3095,106 @@ describe('v1beta1.ScheduleServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts index 6057c874a6d..9c616ee5722 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts @@ -2237,52 +2237,6 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { }); }); - 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 = { @@ -3129,6 +3083,106 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_tensorboard_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_tensorboard_service_v1beta1.ts index 81976b333de..531e60c968f 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_tensorboard_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_tensorboard_service_v1beta1.ts @@ -5528,52 +5528,6 @@ describe('v1beta1.TensorboardServiceClient', () => { }); }); - 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 = { @@ -6450,6 +6404,106 @@ describe('v1beta1.TensorboardServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_vizier_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_vizier_service_v1beta1.ts index 44de0467491..92fba5f6c6b 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_vizier_service_v1beta1.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_vizier_service_v1beta1.ts @@ -3404,52 +3404,6 @@ describe('v1beta1.VizierServiceClient', () => { }); }); - 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 = { @@ -4296,6 +4250,106 @@ describe('v1beta1.VizierServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = "/rendered/path/projectLocationEndpoint"; + 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.projectLocationEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = "/rendered/path/projectLocationPublisherModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + publisher: "publisherValue", + model: "modelValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "publisherValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('savedQuery', () => { const fakePath = "/rendered/path/savedQuery"; const expectedParameters = { From 00669eeea26490be818e913f4ab7d86250baa703 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 27 Apr 2023 22:20:25 +0000 Subject: [PATCH 3/3] =?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 --- .../google-cloud-aiplatform/v1/.eslintignore | 7 - .../google-cloud-aiplatform/v1/.eslintrc.json | 3 - .../google-cloud-aiplatform/v1/.gitignore | 14 - .../google-cloud-aiplatform/v1/.jsdoc.js | 55 - .../google-cloud-aiplatform/v1/.mocharc.js | 33 - .../google-cloud-aiplatform/v1/.prettierrc.js | 22 - .../google-cloud-aiplatform/v1/README.md | 1 - .../v1/linkinator.config.json | 16 - .../google-cloud-aiplatform/v1/package.json | 78 - .../aiplatform/v1/accelerator_type.proto | 61 - .../cloud/aiplatform/v1/annotation.proto | 96 - .../cloud/aiplatform/v1/annotation_spec.proto | 57 - .../google/cloud/aiplatform/v1/artifact.proto | 112 - .../aiplatform/v1/batch_prediction_job.proto | 455 - .../aiplatform/v1/completion_stats.proto | 50 - .../google/cloud/aiplatform/v1/context.proto | 97 - .../cloud/aiplatform/v1/custom_job.proto | 321 - .../cloud/aiplatform/v1/data_item.proto | 73 - .../aiplatform/v1/data_labeling_job.proto | 210 - .../google/cloud/aiplatform/v1/dataset.proto | 201 - .../cloud/aiplatform/v1/dataset_service.proto | 631 - .../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 | 289 - .../aiplatform/v1/endpoint_service.proto | 425 - .../cloud/aiplatform/v1/entity_type.proto | 98 - .../google/cloud/aiplatform/v1/env_var.proto | 42 - .../aiplatform/v1/evaluated_annotation.proto | 181 - .../google/cloud/aiplatform/v1/event.proto | 81 - .../cloud/aiplatform/v1/execution.proto | 118 - .../cloud/aiplatform/v1/explanation.proto | 501 - .../aiplatform/v1/explanation_metadata.proto | 423 - .../google/cloud/aiplatform/v1/feature.proto | 162 - .../v1/feature_monitoring_stats.proto | 87 - .../aiplatform/v1/feature_selector.proto | 44 - .../cloud/aiplatform/v1/featurestore.proto | 152 - .../v1/featurestore_monitoring.proto | 151 - .../v1/featurestore_online_service.proto | 285 - .../aiplatform/v1/featurestore_service.proto | 1444 --- .../v1/hyperparameter_tuning_job.proto | 116 - .../google/cloud/aiplatform/v1/index.proto | 177 - .../cloud/aiplatform/v1/index_endpoint.proto | 285 - .../v1/index_endpoint_service.proto | 362 - .../cloud/aiplatform/v1/index_service.proto | 356 - .../google/cloud/aiplatform/v1/io.proto | 109 - .../cloud/aiplatform/v1/job_service.proto | 1372 --- .../cloud/aiplatform/v1/job_state.proto | 63 - .../aiplatform/v1/lineage_subgraph.proto | 42 - .../aiplatform/v1/machine_resources.proto | 216 - .../v1/manual_batch_tuning_parameters.proto | 39 - .../cloud/aiplatform/v1/metadata_schema.proto | 80 - .../aiplatform/v1/metadata_service.proto | 1389 --- .../cloud/aiplatform/v1/metadata_store.proto | 67 - .../aiplatform/v1/migratable_resource.proto | 155 - .../aiplatform/v1/migration_service.proto | 320 - .../google/cloud/aiplatform/v1/model.proto | 715 -- .../v1/model_deployment_monitoring_job.proto | 326 - .../aiplatform/v1/model_evaluation.proto | 119 - .../v1/model_evaluation_slice.proto | 193 - .../aiplatform/v1/model_monitoring.proto | 219 - .../cloud/aiplatform/v1/model_service.proto | 870 -- .../google/cloud/aiplatform/v1/nas_job.proto | 306 - .../cloud/aiplatform/v1/operation.proto | 55 - .../v1/pipeline_failure_policy.proto | 44 - .../cloud/aiplatform/v1/pipeline_job.proto | 408 - .../aiplatform/v1/pipeline_service.proto | 450 - .../cloud/aiplatform/v1/pipeline_state.proto | 58 - .../aiplatform/v1/prediction_service.proto | 261 - .../cloud/aiplatform/v1/saved_query.proto | 87 - .../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 - .../aiplatform/v1/service_networking.proto | 38 - .../cloud/aiplatform/v1/specialist_pool.proto | 64 - .../v1/specialist_pool_service.proto | 225 - .../google/cloud/aiplatform/v1/study.proto | 602 - .../cloud/aiplatform/v1/tensorboard.proto | 96 - .../aiplatform/v1/tensorboard_data.proto | 104 - .../v1/tensorboard_experiment.proto | 83 - .../cloud/aiplatform/v1/tensorboard_run.proto | 83 - .../aiplatform/v1/tensorboard_service.proto | 1133 -- .../v1/tensorboard_time_series.proto | 112 - .../aiplatform/v1/training_pipeline.proto | 449 - .../google/cloud/aiplatform/v1/types.proto | 49 - .../v1/unmanaged_container_model.proto | 44 - .../aiplatform/v1/user_action_reference.proto | 47 - .../google/cloud/aiplatform/v1/value.proto | 39 - .../cloud/aiplatform/v1/vizier_service.proto | 529 - .../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.search_data_items.js | 145 - .../v1/dataset_service.update_dataset.js | 71 - .../v1/endpoint_service.create_endpoint.js | 83 - .../v1/endpoint_service.delete_endpoint.js | 64 - .../v1/endpoint_service.deploy_model.js | 87 - .../v1/endpoint_service.get_endpoint.js | 63 - .../v1/endpoint_service.list_endpoints.js | 108 - .../v1/endpoint_service.undeploy_model.js | 79 - .../v1/endpoint_service.update_endpoint.js | 67 - ...ine_serving_service.read_feature_values.js | 77 - ...g_service.streaming_read_feature_values.js | 81 - ...ne_serving_service.write_feature_values.js | 72 - ...turestore_service.batch_create_features.js | 73 - ...store_service.batch_read_feature_values.js | 114 - ...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 - ...turestore_service.delete_feature_values.js | 73 - ...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 | 124 - ...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 | 100 - ..._endpoint_service.mutate_deployed_index.js | 71 - .../index_endpoint_service.undeploy_index.js | 70 - ..._endpoint_service.update_index_endpoint.js | 67 - .../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 | 85 - .../v1/index_service.remove_datapoints.js | 67 - .../v1/index_service.update_index.js | 68 - .../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 - .../v1/job_service.cancel_nas_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 | 68 - ....create_model_deployment_monitoring_job.js | 67 - .../v1/job_service.create_nas_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 - .../v1/job_service.delete_nas_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 - .../generated/v1/job_service.get_nas_job.js | 63 - .../v1/job_service.get_nas_trial_detail.js | 63 - .../job_service.list_batch_prediction_jobs.js | 101 - .../v1/job_service.list_custom_jobs.js | 100 - .../v1/job_service.list_data_labeling_jobs.js | 104 - ...service.list_hyperparameter_tuning_jobs.js | 101 - ...e.list_model_deployment_monitoring_jobs.js | 95 - .../generated/v1/job_service.list_nas_jobs.js | 100 - .../v1/job_service.list_nas_trial_details.js | 78 - ...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 | 91 - ...ce.add_context_artifacts_and_executions.js | 76 - .../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 | 78 - .../v1/metadata_service.create_execution.js | 80 - ...metadata_service.create_metadata_schema.js | 79 - .../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 | 116 - .../v1/metadata_service.list_contexts.js | 119 - .../v1/metadata_service.list_executions.js | 116 - .../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 | 63 - ...etadata_service.remove_context_children.js | 67 - .../v1/metadata_service.update_artifact.js | 75 - .../v1/metadata_service.update_context.js | 74 - .../v1/metadata_service.update_execution.js | 75 - ...gration_service.batch_migrate_resources.js | 70 - ...ion_service.search_migratable_resources.js | 89 - ...vice.batch_import_evaluated_annotations.js | 68 - ...ce.batch_import_model_evaluation_slices.js | 68 - .../generated/v1/model_service.copy_model.js | 88 - .../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 | 87 - .../model_service.list_model_evaluations.js | 85 - .../v1/model_service.list_model_versions.js | 100 - .../generated/v1/model_service.list_models.js | 108 - .../v1/model_service.merge_version_aliases.js | 78 - .../v1/model_service.update_model.js | 85 - .../v1/model_service.upload_model.js | 90 - .../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 | 128 - ...ipeline_service.list_training_pipelines.js | 100 - .../v1/prediction_service.explain.js | 101 - .../v1/prediction_service.predict.js | 84 - .../v1/prediction_service.raw_predict.js | 79 - ...t_metadata.google.cloud.aiplatform.v1.json | 9643 --------------- ...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 | 81 - ...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 | 73 - .../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 - ...sorboard_service.read_tensorboard_usage.js | 63 - .../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 - .../google-cloud-aiplatform/v1/src/index.ts | 53 - .../v1/src/v1/dataset_service_client.ts | 4823 -------- .../src/v1/dataset_service_client_config.json | 74 - .../v1/src/v1/dataset_service_proto_list.json | 115 - .../v1/src/v1/endpoint_service_client.ts | 3975 ------ .../v1/endpoint_service_client_config.json | 58 - .../src/v1/endpoint_service_proto_list.json | 115 - ...turestore_online_serving_service_client.ts | 2957 ----- ..._online_serving_service_client_config.json | 38 - ...ore_online_serving_service_proto_list.json | 115 - .../v1/src/v1/featurestore_service_client.ts | 6109 --------- .../featurestore_service_client_config.json | 110 - .../v1/featurestore_service_proto_list.json | 115 - .../v1/src/v1/gapic_metadata.json | 2439 ---- .../v1/src/v1/index.ts | 33 - .../src/v1/index_endpoint_service_client.ts | 3901 ------ .../index_endpoint_service_client_config.json | 58 - .../v1/index_endpoint_service_proto_list.json | 115 - .../v1/src/v1/index_service_client.ts | 3717 ------ .../src/v1/index_service_client_config.json | 54 - .../v1/src/v1/index_service_proto_list.json | 115 - .../v1/src/v1/job_service_client.ts | 7238 ----------- .../v1/src/v1/job_service_client_config.json | 166 - .../v1/src/v1/job_service_proto_list.json | 115 - .../v1/src/v1/metadata_service_client.ts | 6749 ---------- .../v1/metadata_service_client_config.json | 154 - .../src/v1/metadata_service_proto_list.json | 115 - .../v1/src/v1/migration_service_client.ts | 3314 ----- .../v1/migration_service_client_config.json | 34 - .../src/v1/migration_service_proto_list.json | 115 - .../v1/src/v1/model_service_client.ts | 5134 -------- .../src/v1/model_service_client_config.json | 94 - .../v1/src/v1/model_service_proto_list.json | 115 - .../v1/src/v1/pipeline_service_client.ts | 4265 ------- .../v1/pipeline_service_client_config.json | 66 - .../src/v1/pipeline_service_proto_list.json | 115 - .../v1/src/v1/prediction_service_client.ts | 3030 ----- .../v1/prediction_service_client_config.json | 38 - .../src/v1/prediction_service_proto_list.json | 115 - .../src/v1/specialist_pool_service_client.ts | 3564 ------ ...specialist_pool_service_client_config.json | 46 - .../specialist_pool_service_proto_list.json | 115 - .../v1/src/v1/tensorboard_service_client.ts | 6135 --------- .../v1/tensorboard_service_client_config.json | 142 - .../v1/tensorboard_service_proto_list.json | 115 - .../v1/src/v1/vizier_service_client.ts | 4388 ------- .../src/v1/vizier_service_client_config.json | 86 - .../v1/src/v1/vizier_service_proto_list.json | 115 - .../system-test/fixtures/sample/src/index.js | 41 - .../system-test/fixtures/sample/src/index.ts | 116 - .../v1/system-test/install.ts | 49 - .../v1/test/gapic_dataset_service_v1.ts | 4968 -------- .../v1/test/gapic_endpoint_service_v1.ts | 4034 ------ ..._featurestore_online_serving_service_v1.ts | 2790 ----- .../v1/test/gapic_featurestore_service_v1.ts | 6209 ---------- .../test/gapic_index_endpoint_service_v1.ts | 4034 ------ .../v1/test/gapic_index_service_v1.ts | 3834 ------ .../v1/test/gapic_job_service_v1.ts | 8001 ------------ .../v1/test/gapic_metadata_service_v1.ts | 7350 ----------- .../v1/test/gapic_migration_service_v1.ts | 3198 ----- .../v1/test/gapic_model_service_v1.ts | 5417 -------- .../v1/test/gapic_pipeline_service_v1.ts | 4245 ------- .../v1/test/gapic_prediction_service_v1.ts | 2787 ----- .../test/gapic_specialist_pool_service_v1.ts | 3618 ------ .../v1/test/gapic_tensorboard_service_v1.ts | 6939 ----------- .../v1/test/gapic_vizier_service_v1.ts | 4785 ------- .../google-cloud-aiplatform/v1/tsconfig.json | 19 - .../v1/webpack.config.js | 64 - .../v1beta1/.eslintignore | 7 - .../v1beta1/.eslintrc.json | 3 - .../v1beta1/.gitignore | 14 - .../google-cloud-aiplatform/v1beta1/.jsdoc.js | 55 - .../v1beta1/.mocharc.js | 33 - .../v1beta1/.prettierrc.js | 22 - .../google-cloud-aiplatform/v1beta1/README.md | 1 - .../v1beta1/linkinator.config.json | 16 - .../v1beta1/package.json | 81 - .../aiplatform/v1beta1/accelerator_type.proto | 64 - .../cloud/aiplatform/v1beta1/annotation.proto | 96 - .../aiplatform/v1beta1/annotation_spec.proto | 57 - .../cloud/aiplatform/v1beta1/artifact.proto | 112 - .../v1beta1/batch_prediction_job.proto | 472 - .../aiplatform/v1beta1/completion_stats.proto | 50 - .../cloud/aiplatform/v1beta1/context.proto | 97 - .../cloud/aiplatform/v1beta1/custom_job.proto | 321 - .../cloud/aiplatform/v1beta1/data_item.proto | 74 - .../v1beta1/data_labeling_job.proto | 210 - .../cloud/aiplatform/v1beta1/dataset.proto | 202 - .../aiplatform/v1beta1/dataset_service.proto | 631 - .../v1beta1/deployed_index_ref.proto | 42 - .../v1beta1/deployed_model_ref.proto | 42 - .../v1beta1/deployment_resource_pool.proto | 53 - .../deployment_resource_pool_service.proto | 236 - .../aiplatform/v1beta1/encryption_spec.proto | 38 - .../cloud/aiplatform/v1beta1/endpoint.proto | 300 - .../aiplatform/v1beta1/endpoint_service.proto | 415 - .../aiplatform/v1beta1/entity_type.proto | 98 - .../cloud/aiplatform/v1beta1/env_var.proto | 42 - .../v1beta1/evaluated_annotation.proto | 181 - .../cloud/aiplatform/v1beta1/event.proto | 81 - .../cloud/aiplatform/v1beta1/execution.proto | 118 - .../aiplatform/v1beta1/explanation.proto | 569 - .../v1beta1/explanation_metadata.proto | 424 - .../cloud/aiplatform/v1beta1/feature.proto | 186 - .../v1beta1/feature_monitoring_stats.proto | 87 - .../aiplatform/v1beta1/feature_selector.proto | 44 - .../aiplatform/v1beta1/featurestore.proto | 152 - .../v1beta1/featurestore_monitoring.proto | 163 - .../v1beta1/featurestore_online_service.proto | 285 - .../v1beta1/featurestore_service.proto | 1444 --- .../v1beta1/hyperparameter_tuning_job.proto | 116 - .../cloud/aiplatform/v1beta1/index.proto | 177 - .../aiplatform/v1beta1/index_endpoint.proto | 286 - .../v1beta1/index_endpoint_service.proto | 362 - .../aiplatform/v1beta1/index_service.proto | 356 - .../google/cloud/aiplatform/v1beta1/io.proto | 109 - .../aiplatform/v1beta1/job_service.proto | 1372 --- .../cloud/aiplatform/v1beta1/job_state.proto | 63 - .../aiplatform/v1beta1/lineage_subgraph.proto | 42 - .../v1beta1/machine_resources.proto | 216 - .../manual_batch_tuning_parameters.proto | 39 - .../aiplatform/v1beta1/match_service.proto | 176 - .../aiplatform/v1beta1/metadata_schema.proto | 80 - .../aiplatform/v1beta1/metadata_service.proto | 1392 --- .../aiplatform/v1beta1/metadata_store.proto | 67 - .../v1beta1/migratable_resource.proto | 155 - .../v1beta1/migration_service.proto | 321 - .../cloud/aiplatform/v1beta1/model.proto | 727 -- .../model_deployment_monitoring_job.proto | 326 - .../aiplatform/v1beta1/model_evaluation.proto | 96 - .../v1beta1/model_evaluation_slice.proto | 194 - .../aiplatform/v1beta1/model_monitoring.proto | 250 - .../aiplatform/v1beta1/model_service.proto | 902 -- .../cloud/aiplatform/v1beta1/nas_job.proto | 306 - .../cloud/aiplatform/v1beta1/operation.proto | 55 - .../v1beta1/pipeline_failure_policy.proto | 44 - .../aiplatform/v1beta1/pipeline_job.proto | 409 - .../aiplatform/v1beta1/pipeline_service.proto | 450 - .../aiplatform/v1beta1/pipeline_state.proto | 58 - .../v1beta1/prediction_service.proto | 264 - .../aiplatform/v1beta1/saved_query.proto | 87 - .../cloud/aiplatform/v1beta1/schedule.proto | 172 - .../aiplatform/v1beta1/schedule_service.proto | 276 - .../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 - .../v1beta1/service_networking.proto | 38 - .../aiplatform/v1beta1/specialist_pool.proto | 64 - .../v1beta1/specialist_pool_service.proto | 225 - .../cloud/aiplatform/v1beta1/study.proto | 663 - .../aiplatform/v1beta1/tensorboard.proto | 96 - .../aiplatform/v1beta1/tensorboard_data.proto | 104 - .../v1beta1/tensorboard_experiment.proto | 83 - .../aiplatform/v1beta1/tensorboard_run.proto | 83 - .../v1beta1/tensorboard_service.proto | 1132 -- .../v1beta1/tensorboard_time_series.proto | 112 - .../v1beta1/training_pipeline.proto | 450 - .../cloud/aiplatform/v1beta1/types.proto | 49 - .../v1beta1/unmanaged_container_model.proto | 44 - .../v1beta1/user_action_reference.proto | 47 - .../cloud/aiplatform/v1beta1/value.proto | 39 - .../aiplatform/v1beta1/vizier_service.proto | 529 - .../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 - .../dataset_service.search_data_items.js | 145 - .../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 | 83 - .../endpoint_service.delete_endpoint.js | 64 - .../v1beta1/endpoint_service.deploy_model.js | 87 - .../v1beta1/endpoint_service.get_endpoint.js | 63 - .../endpoint_service.list_endpoints.js | 98 - .../endpoint_service.undeploy_model.js | 79 - .../endpoint_service.update_endpoint.js | 67 - ...ine_serving_service.read_feature_values.js | 77 - ...g_service.streaming_read_feature_values.js | 81 - ...ne_serving_service.write_feature_values.js | 72 - ...turestore_service.batch_create_features.js | 73 - ...store_service.batch_read_feature_values.js | 114 - ...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 - ...turestore_service.delete_feature_values.js | 73 - ...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 | 124 - ...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 | 100 - ..._endpoint_service.mutate_deployed_index.js | 71 - .../index_endpoint_service.undeploy_index.js | 70 - ..._endpoint_service.update_index_endpoint.js | 67 - .../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 | 85 - .../index_service.remove_datapoints.js | 67 - .../v1beta1/index_service.update_index.js | 68 - .../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 - .../v1beta1/job_service.cancel_nas_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 | 68 - ....create_model_deployment_monitoring_job.js | 67 - .../v1beta1/job_service.create_nas_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 - .../v1beta1/job_service.delete_nas_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 - .../v1beta1/job_service.get_nas_job.js | 63 - .../job_service.get_nas_trial_detail.js | 63 - .../job_service.list_batch_prediction_jobs.js | 101 - .../v1beta1/job_service.list_custom_jobs.js | 100 - .../job_service.list_data_labeling_jobs.js | 104 - ...service.list_hyperparameter_tuning_jobs.js | 101 - ...e.list_model_deployment_monitoring_jobs.js | 95 - .../v1beta1/job_service.list_nas_jobs.js | 100 - .../job_service.list_nas_trial_details.js | 78 - ...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 | 91 - .../v1beta1/match_service.find_neighbors.js | 83 - .../match_service.read_index_datapoints.js | 71 - ...ce.add_context_artifacts_and_executions.js | 76 - .../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 | 78 - .../metadata_service.create_execution.js | 80 - ...metadata_service.create_metadata_schema.js | 79 - .../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 | 116 - .../v1beta1/metadata_service.list_contexts.js | 119 - .../metadata_service.list_executions.js | 116 - .../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 | 63 - ...etadata_service.remove_context_children.js | 67 - .../metadata_service.update_artifact.js | 76 - .../metadata_service.update_context.js | 75 - .../metadata_service.update_execution.js | 76 - ...gration_service.batch_migrate_resources.js | 70 - ...ion_service.search_migratable_resources.js | 90 - ...vice.batch_import_evaluated_annotations.js | 68 - ...ce.batch_import_model_evaluation_slices.js | 68 - .../v1beta1/model_service.copy_model.js | 88 - .../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 | 87 - .../model_service.list_model_evaluations.js | 85 - .../model_service.list_model_versions.js | 100 - .../v1beta1/model_service.list_models.js | 98 - .../model_service.merge_version_aliases.js | 78 - ...odel_service.update_explanation_dataset.js | 67 - .../v1beta1/model_service.update_model.js | 85 - .../v1beta1/model_service.upload_model.js | 90 - .../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 | 128 - ...ipeline_service.list_training_pipelines.js | 100 - .../v1beta1/prediction_service.explain.js | 102 - .../v1beta1/prediction_service.predict.js | 85 - .../v1beta1/prediction_service.raw_predict.js | 79 - .../schedule_service.create_schedule.js | 67 - .../schedule_service.delete_schedule.js | 64 - .../v1beta1/schedule_service.get_schedule.js | 63 - .../schedule_service.list_schedules.js | 122 - .../schedule_service.pause_schedule.js | 63 - .../schedule_service.resume_schedule.js | 71 - ...adata.google.cloud.aiplatform.v1beta1.json | 10267 ---------------- ...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 | 81 - ...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 | 73 - .../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 - ...sorboard_service.read_tensorboard_usage.js | 63 - .../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 - .../v1beta1/src/index.ts | 59 - .../src/v1beta1/dataset_service_client.ts | 4927 -------- .../dataset_service_client_config.json | 84 - .../v1beta1/dataset_service_proto_list.json | 127 - ...deployment_resource_pool_service_client.ts | 3788 ------ ...t_resource_pool_service_client_config.json | 46 - ...ment_resource_pool_service_proto_list.json | 127 - .../src/v1beta1/endpoint_service_client.ts | 4052 ------ .../endpoint_service_client_config.json | 65 - .../v1beta1/endpoint_service_proto_list.json | 127 - ...turestore_online_serving_service_client.ts | 3061 ----- ..._online_serving_service_client_config.json | 40 - ...ore_online_serving_service_proto_list.json | 127 - .../v1beta1/featurestore_service_client.ts | 6213 ---------- .../featurestore_service_client_config.json | 129 - .../featurestore_service_proto_list.json | 127 - .../v1beta1/src/v1beta1/gapic_metadata.json | 2633 ---- .../v1beta1/src/v1beta1/index.ts | 36 - .../v1beta1/index_endpoint_service_client.ts | 4005 ------ .../index_endpoint_service_client_config.json | 65 - .../index_endpoint_service_proto_list.json | 127 - .../src/v1beta1/index_service_client.ts | 3821 ------ .../v1beta1/index_service_client_config.json | 59 - .../src/v1beta1/index_service_proto_list.json | 127 - .../v1beta1/src/v1beta1/job_service_client.ts | 7342 ----------- .../v1beta1/job_service_client_config.json | 194 - .../src/v1beta1/job_service_proto_list.json | 127 - .../src/v1beta1/match_service_client.ts | 2999 ----- .../v1beta1/match_service_client_config.json | 34 - .../src/v1beta1/match_service_proto_list.json | 127 - .../src/v1beta1/metadata_service_client.ts | 6856 ----------- .../metadata_service_client_config.json | 179 - .../v1beta1/metadata_service_proto_list.json | 127 - .../src/v1beta1/migration_service_client.ts | 3421 ----- .../migration_service_client_config.json | 34 - .../v1beta1/migration_service_proto_list.json | 127 - .../src/v1beta1/model_service_client.ts | 5310 -------- .../v1beta1/model_service_client_config.json | 109 - .../src/v1beta1/model_service_proto_list.json | 127 - .../src/v1beta1/pipeline_service_client.ts | 4369 ------- .../pipeline_service_client_config.json | 71 - .../v1beta1/pipeline_service_proto_list.json | 127 - .../src/v1beta1/prediction_service_client.ts | 3136 ----- .../prediction_service_client_config.json | 40 - .../prediction_service_proto_list.json | 127 - .../src/v1beta1/schedule_service_client.ts | 3835 ------ .../schedule_service_client_config.json | 50 - .../v1beta1/schedule_service_proto_list.json | 127 - .../v1beta1/specialist_pool_service_client.ts | 3668 ------ ...specialist_pool_service_client_config.json | 51 - .../specialist_pool_service_proto_list.json | 127 - .../src/v1beta1/tensorboard_service_client.ts | 6238 ---------- .../tensorboard_service_client_config.json | 142 - .../tensorboard_service_proto_list.json | 127 - .../src/v1beta1/vizier_service_client.ts | 4492 ------- .../v1beta1/vizier_service_client_config.json | 101 - .../v1beta1/vizier_service_proto_list.json | 127 - .../system-test/fixtures/sample/src/index.js | 44 - .../system-test/fixtures/sample/src/index.ts | 134 - .../v1beta1/system-test/install.ts | 49 - .../test/gapic_dataset_service_v1beta1.ts | 5060 -------- ...eployment_resource_pool_service_v1beta1.ts | 3827 ------ .../test/gapic_endpoint_service_v1beta1.ts | 4126 ------- ...urestore_online_serving_service_v1beta1.ts | 2882 ----- .../gapic_featurestore_service_v1beta1.ts | 6301 ---------- .../gapic_index_endpoint_service_v1beta1.ts | 4126 ------- .../test/gapic_index_service_v1beta1.ts | 3926 ------ .../v1beta1/test/gapic_job_service_v1beta1.ts | 8093 ------------ .../test/gapic_match_service_v1beta1.ts | 2771 ----- .../test/gapic_metadata_service_v1beta1.ts | 7442 ----------- .../test/gapic_migration_service_v1beta1.ts | 3290 ----- .../test/gapic_model_service_v1beta1.ts | 5663 --------- .../test/gapic_pipeline_service_v1beta1.ts | 4337 ------- .../test/gapic_prediction_service_v1beta1.ts | 2879 ----- .../test/gapic_schedule_service_v1beta1.ts | 3722 ------ .../gapic_specialist_pool_service_v1beta1.ts | 3710 ------ .../test/gapic_tensorboard_service_v1beta1.ts | 7031 ----------- .../test/gapic_vizier_service_v1beta1.ts | 4877 -------- .../v1beta1/tsconfig.json | 19 - .../v1beta1/webpack.config.js | 64 - packages/google-cloud-aiplatform/README.md | 2 + .../aiplatform/v1/accelerator_type.proto | 3 + .../aiplatform/v1/batch_prediction_job.proto | 4 +- .../cloud/aiplatform/v1/custom_job.proto | 20 + .../google/cloud/aiplatform/v1/dataset.proto | 8 +- .../google/cloud/aiplatform/v1/endpoint.proto | 12 +- .../aiplatform/v1/endpoint_service.proto | 65 + .../cloud/aiplatform/v1/entity_type.proto | 7 + .../aiplatform/v1/evaluated_annotation.proto | 4 - .../cloud/aiplatform/v1/explanation.proto | 4 +- .../google/cloud/aiplatform/v1/feature.proto | 9 +- .../cloud/aiplatform/v1/featurestore.proto | 8 + .../v1/featurestore_online_service.proto | 2 +- .../aiplatform/v1/featurestore_service.proto | 4 +- .../cloud/aiplatform/v1/index_endpoint.proto | 4 +- .../google/cloud/aiplatform/v1/model.proto | 3 + .../aiplatform/v1/model_monitoring.proto | 4 + .../cloud/aiplatform/v1/model_service.proto | 6 +- .../cloud/aiplatform/v1/pipeline_job.proto | 2 +- .../aiplatform/v1/prediction_service.proto | 8 + .../v1/tensorboard_experiment.proto | 14 +- .../aiplatform/v1/tensorboard_service.proto | 13 +- .../aiplatform/v1beta1/accelerator_type.proto | 5 +- .../v1beta1/batch_prediction_job.proto | 4 +- .../cloud/aiplatform/v1beta1/custom_job.proto | 20 + .../cloud/aiplatform/v1beta1/dataset.proto | 8 +- .../cloud/aiplatform/v1beta1/endpoint.proto | 10 +- .../aiplatform/v1beta1/endpoint_service.proto | 65 + .../v1beta1/evaluated_annotation.proto | 4 - .../aiplatform/v1beta1/explanation.proto | 29 +- .../cloud/aiplatform/v1beta1/feature.proto | 13 +- .../v1beta1/featurestore_online_service.proto | 2 +- .../v1beta1/featurestore_service.proto | 4 +- .../aiplatform/v1beta1/index_endpoint.proto | 4 +- .../aiplatform/v1beta1/match_service.proto | 4 +- .../cloud/aiplatform/v1beta1/model.proto | 3 + .../aiplatform/v1beta1/model_service.proto | 6 +- .../aiplatform/v1beta1/pipeline_job.proto | 2 +- .../v1beta1/prediction_service.proto | 8 + .../cloud/aiplatform/v1beta1/schedule.proto | 25 +- .../aiplatform/v1beta1/schedule_service.proto | 1 + .../v1beta1/tensorboard_experiment.proto | 14 +- .../v1beta1/tensorboard_service.proto | 13 +- .../protos/protos.d.ts | 807 +- .../google-cloud-aiplatform/protos/protos.js | 1872 +++ .../protos/protos.json | 261 +- .../google-cloud-aiplatform/samples/README.md | 36 + .../endpoint_service.mutate_deployed_model.js | 0 ...featurestore_service.update_entity_type.js | 2 +- ...eaturestore_service.update_featurestore.js | 2 +- .../v1/model_service.list_model_versions.js | 6 +- ...t_metadata.google.cloud.aiplatform.v1.json | 50 +- ...ice.export_tensorboard_time_series_data.js | 8 +- .../endpoint_service.mutate_deployed_model.js | 0 ...featurestore_service.update_entity_type.js | 2 +- ...eaturestore_service.update_featurestore.js | 2 +- .../v1beta1/match_service.find_neighbors.js | 2 +- .../match_service.read_index_datapoints.js | 2 +- .../model_service.list_model_versions.js | 6 +- ...adata.google.cloud.aiplatform.v1beta1.json | 50 +- ...ice.export_tensorboard_time_series_data.js | 8 +- .../src/v1/dataset_service_client.ts | 227 +- .../src/v1/endpoint_service_client.ts | 398 +- .../v1/endpoint_service_client_config.json | 4 + ...turestore_online_serving_service_client.ts | 207 +- .../src/v1/featurestore_service_client.ts | 231 +- .../src/v1/gapic_metadata.json | 10 + .../src/v1/index_endpoint_service_client.ts | 227 +- .../src/v1/index_service_client.ts | 227 +- .../src/v1/job_service_client.ts | 227 +- .../src/v1/metadata_service_client.ts | 227 +- .../src/v1/migration_service_client.ts | 227 +- .../src/v1/model_service_client.ts | 245 +- .../src/v1/pipeline_service_client.ts | 227 +- .../src/v1/prediction_service_client.ts | 207 +- .../src/v1/specialist_pool_service_client.ts | 227 +- .../src/v1/tensorboard_service_client.ts | 251 +- .../src/v1/vizier_service_client.ts | 227 +- .../src/v1beta1/dataset_service_client.ts | 273 +- ...deployment_resource_pool_service_client.ts | 273 +- .../src/v1beta1/endpoint_service_client.ts | 444 +- .../endpoint_service_client_config.json | 4 + ...turestore_online_serving_service_client.ts | 207 +- .../v1beta1/featurestore_service_client.ts | 277 +- .../src/v1beta1/gapic_metadata.json | 10 + .../v1beta1/index_endpoint_service_client.ts | 273 +- .../src/v1beta1/index_service_client.ts | 273 +- .../src/v1beta1/job_service_client.ts | 273 +- .../src/v1beta1/match_service_client.ts | 211 +- .../src/v1beta1/metadata_service_client.ts | 273 +- .../src/v1beta1/migration_service_client.ts | 273 +- .../src/v1beta1/model_service_client.ts | 291 +- .../src/v1beta1/pipeline_service_client.ts | 273 +- .../src/v1beta1/prediction_service_client.ts | 207 +- .../src/v1beta1/schedule_service_client.ts | 273 +- .../v1beta1/specialist_pool_service_client.ts | 273 +- .../src/v1beta1/tensorboard_service_client.ts | 297 +- .../src/v1beta1/vizier_service_client.ts | 273 +- .../test/gapic_dataset_service_v1.ts | 236 +- .../test/gapic_dataset_service_v1beta1.ts | 236 +- ...eployment_resource_pool_service_v1beta1.ts | 245 +- .../test/gapic_endpoint_service_v1.ts | 430 +- .../test/gapic_endpoint_service_v1beta1.ts | 430 +- ..._featurestore_online_serving_service_v1.ts | 245 +- ...urestore_online_serving_service_v1beta1.ts | 245 +- .../test/gapic_featurestore_service_v1.ts | 242 +- .../gapic_featurestore_service_v1beta1.ts | 239 +- .../test/gapic_index_endpoint_service_v1.ts | 239 +- .../gapic_index_endpoint_service_v1beta1.ts | 239 +- .../test/gapic_index_service_v1.ts | 236 +- .../test/gapic_index_service_v1beta1.ts | 236 +- .../test/gapic_job_service_v1.ts | 236 +- .../test/gapic_job_service_v1beta1.ts | 236 +- .../test/gapic_match_service_v1beta1.ts | 236 +- .../test/gapic_metadata_service_v1.ts | 236 +- .../test/gapic_metadata_service_v1beta1.ts | 236 +- .../test/gapic_migration_service_v1.ts | 236 +- .../test/gapic_migration_service_v1beta1.ts | 236 +- .../test/gapic_model_service_v1.ts | 236 +- .../test/gapic_model_service_v1beta1.ts | 236 +- .../test/gapic_pipeline_service_v1.ts | 236 +- .../test/gapic_pipeline_service_v1beta1.ts | 236 +- .../test/gapic_prediction_service_v1.ts | 236 +- .../test/gapic_prediction_service_v1beta1.ts | 239 +- .../test/gapic_schedule_service_v1beta1.ts | 236 +- .../test/gapic_specialist_pool_service_v1.ts | 239 +- .../gapic_specialist_pool_service_v1beta1.ts | 239 +- .../test/gapic_tensorboard_service_v1.ts | 236 +- .../test/gapic_tensorboard_service_v1beta1.ts | 239 +- .../test/gapic_vizier_service_v1.ts | 236 +- .../test/gapic_vizier_service_v1beta1.ts | 236 +- 963 files changed, 16326 insertions(+), 422328 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/README.md delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/linkinator.config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/package.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/accelerator_type.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/annotation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/annotation_spec.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/artifact.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/context.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/custom_job.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/data_item.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/data_labeling_job.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/dataset.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/deployed_index_ref.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/deployed_model_ref.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/encryption_spec.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/endpoint.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/endpoint_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/entity_type.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/env_var.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/evaluated_annotation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/event.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/execution.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/explanation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/explanation_metadata.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature_selector.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_endpoint.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_endpoint_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/io.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/job_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/job_state.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/lineage_subgraph.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/machine_resources.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_schema.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_store.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/migratable_resource.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/migration_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_evaluation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/nas_job.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/operation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_state.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/prediction_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/saved_query.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/service_networking.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/specialist_pool.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/specialist_pool_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/study.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_data.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_run.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/types.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/user_action_reference.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/value.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/vizier_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.create_dataset.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.delete_dataset.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.export_data.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.get_annotation_spec.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.get_dataset.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.import_data.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.list_annotations.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.list_data_items.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.list_datasets.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.list_saved_queries.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.search_data_items.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/dataset_service.update_dataset.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.create_endpoint.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.delete_endpoint.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.deploy_model.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.get_endpoint.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.list_endpoints.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.undeploy_model.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.update_endpoint.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_online_serving_service.read_feature_values.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_online_serving_service.streaming_read_feature_values.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_online_serving_service.write_feature_values.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.batch_create_features.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.batch_read_feature_values.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.create_entity_type.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.create_feature.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.create_featurestore.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.delete_entity_type.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.delete_feature.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.delete_feature_values.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.delete_featurestore.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.export_feature_values.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.get_entity_type.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.get_feature.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.get_featurestore.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.import_feature_values.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.list_entity_types.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.list_features.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.list_featurestores.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.search_features.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.update_entity_type.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.update_feature.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/featurestore_service.update_featurestore.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_endpoint_service.create_index_endpoint.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_endpoint_service.delete_index_endpoint.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_endpoint_service.deploy_index.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_endpoint_service.get_index_endpoint.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_endpoint_service.list_index_endpoints.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_endpoint_service.mutate_deployed_index.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_endpoint_service.undeploy_index.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_endpoint_service.update_index_endpoint.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_service.create_index.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_service.delete_index.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_service.get_index.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_service.list_indexes.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_service.remove_datapoints.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_service.update_index.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/index_service.upsert_datapoints.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.cancel_batch_prediction_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.cancel_custom_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.cancel_data_labeling_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.cancel_hyperparameter_tuning_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.cancel_nas_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.create_batch_prediction_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.create_custom_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.create_data_labeling_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.create_hyperparameter_tuning_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.create_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.create_nas_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.delete_batch_prediction_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.delete_custom_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.delete_data_labeling_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.delete_hyperparameter_tuning_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.delete_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.delete_nas_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.get_batch_prediction_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.get_custom_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.get_data_labeling_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.get_hyperparameter_tuning_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.get_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.get_nas_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.get_nas_trial_detail.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.list_batch_prediction_jobs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.list_custom_jobs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.list_data_labeling_jobs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.list_hyperparameter_tuning_jobs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.list_model_deployment_monitoring_jobs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.list_nas_jobs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.list_nas_trial_details.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.pause_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.resume_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.search_model_deployment_monitoring_stats_anomalies.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/job_service.update_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.add_context_artifacts_and_executions.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.add_context_children.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.add_execution_events.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.create_artifact.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.create_context.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.create_execution.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.create_metadata_schema.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.create_metadata_store.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.delete_artifact.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.delete_context.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.delete_execution.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.delete_metadata_store.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.get_artifact.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.get_context.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.get_execution.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.get_metadata_schema.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.get_metadata_store.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.list_artifacts.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.list_contexts.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.list_executions.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.list_metadata_schemas.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.list_metadata_stores.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.purge_artifacts.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.purge_contexts.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.purge_executions.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.query_artifact_lineage_subgraph.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.query_context_lineage_subgraph.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.query_execution_inputs_and_outputs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.remove_context_children.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.update_artifact.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.update_context.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/metadata_service.update_execution.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/migration_service.batch_migrate_resources.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/migration_service.search_migratable_resources.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.batch_import_evaluated_annotations.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.batch_import_model_evaluation_slices.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.copy_model.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.delete_model.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.delete_model_version.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.export_model.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.get_model.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.get_model_evaluation.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.get_model_evaluation_slice.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.import_model_evaluation.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.list_model_evaluation_slices.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.list_model_evaluations.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.list_model_versions.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.list_models.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.merge_version_aliases.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.update_model.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/model_service.upload_model.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.cancel_pipeline_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.cancel_training_pipeline.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.create_pipeline_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.create_training_pipeline.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.delete_pipeline_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.delete_training_pipeline.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.get_pipeline_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.get_training_pipeline.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.list_pipeline_jobs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/pipeline_service.list_training_pipelines.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/prediction_service.explain.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/prediction_service.predict.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/prediction_service.raw_predict.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/specialist_pool_service.create_specialist_pool.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/specialist_pool_service.delete_specialist_pool.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/specialist_pool_service.get_specialist_pool.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/specialist_pool_service.list_specialist_pools.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/specialist_pool_service.update_specialist_pool.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.batch_create_tensorboard_runs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.batch_create_tensorboard_time_series.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.batch_read_tensorboard_time_series_data.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.create_tensorboard.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.create_tensorboard_experiment.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.create_tensorboard_run.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.create_tensorboard_time_series.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.delete_tensorboard.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.delete_tensorboard_experiment.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.delete_tensorboard_run.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.delete_tensorboard_time_series.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.export_tensorboard_time_series_data.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.get_tensorboard.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.get_tensorboard_experiment.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.get_tensorboard_run.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.get_tensorboard_time_series.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.list_tensorboard_experiments.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.list_tensorboard_runs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.list_tensorboard_time_series.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.list_tensorboards.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.read_tensorboard_blob_data.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.read_tensorboard_time_series_data.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.read_tensorboard_usage.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.update_tensorboard.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.update_tensorboard_experiment.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.update_tensorboard_run.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.update_tensorboard_time_series.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.write_tensorboard_experiment_data.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/tensorboard_service.write_tensorboard_run_data.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.add_trial_measurement.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.check_trial_early_stopping_state.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.complete_trial.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.create_study.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.create_trial.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.delete_study.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.delete_trial.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.get_study.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.get_trial.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.list_optimal_trials.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.list_studies.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.list_trials.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.lookup_study.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.stop_trial.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/vizier_service.suggest_trials.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/dataset_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/dataset_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/dataset_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/migration_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/migration_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/migration_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/pipeline_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/pipeline_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/pipeline_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/vizier_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/vizier_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/src/v1/vizier_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_dataset_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_endpoint_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_featurestore_online_serving_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_featurestore_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_index_endpoint_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_index_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_job_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_metadata_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_migration_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_model_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_pipeline_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_prediction_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_specialist_pool_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_tensorboard_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_vizier_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1/webpack.config.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/linkinator.config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/package.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/artifact.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/context.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_item.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/entity_type.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/env_var.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/event.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/execution.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_selector.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/io.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_state.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/match_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_store.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/migration_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/nas_job.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/operation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_failure_policy.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/saved_query.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/service_networking.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/study.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/types.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/value.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/vizier_service.proto delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.create_dataset.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.delete_dataset.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.export_data.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.get_annotation_spec.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.get_dataset.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.import_data.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.list_annotations.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.list_data_items.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.list_datasets.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.list_saved_queries.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.search_data_items.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/dataset_service.update_dataset.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.create_deployment_resource_pool.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.delete_deployment_resource_pool.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.get_deployment_resource_pool.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.list_deployment_resource_pools.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.query_deployed_models.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.create_endpoint.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.delete_endpoint.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.deploy_model.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.get_endpoint.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.list_endpoints.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.undeploy_model.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.update_endpoint.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_online_serving_service.read_feature_values.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_online_serving_service.streaming_read_feature_values.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_online_serving_service.write_feature_values.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.batch_create_features.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.batch_read_feature_values.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.create_entity_type.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.create_feature.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.create_featurestore.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.delete_entity_type.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.delete_feature.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.delete_feature_values.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.delete_featurestore.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.export_feature_values.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.get_entity_type.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.get_feature.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.get_featurestore.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.import_feature_values.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.list_entity_types.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.list_features.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.list_featurestores.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.search_features.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.update_entity_type.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.update_feature.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/featurestore_service.update_featurestore.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_endpoint_service.delete_index_endpoint.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_endpoint_service.deploy_index.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_endpoint_service.get_index_endpoint.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_endpoint_service.list_index_endpoints.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_endpoint_service.mutate_deployed_index.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_endpoint_service.undeploy_index.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_endpoint_service.update_index_endpoint.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_service.create_index.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_service.delete_index.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_service.get_index.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_service.list_indexes.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_service.remove_datapoints.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_service.update_index.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/index_service.upsert_datapoints.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.cancel_batch_prediction_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.cancel_custom_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.cancel_data_labeling_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.cancel_hyperparameter_tuning_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.cancel_nas_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.create_batch_prediction_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.create_custom_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.create_data_labeling_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.create_hyperparameter_tuning_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.create_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.create_nas_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.delete_batch_prediction_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.delete_custom_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.delete_data_labeling_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.delete_hyperparameter_tuning_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.delete_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.delete_nas_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.get_batch_prediction_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.get_custom_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.get_data_labeling_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.get_hyperparameter_tuning_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.get_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.get_nas_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.get_nas_trial_detail.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.list_batch_prediction_jobs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.list_custom_jobs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.list_data_labeling_jobs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.list_hyperparameter_tuning_jobs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.list_model_deployment_monitoring_jobs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.list_nas_jobs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.list_nas_trial_details.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.pause_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.resume_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.search_model_deployment_monitoring_stats_anomalies.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/job_service.update_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/match_service.find_neighbors.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/match_service.read_index_datapoints.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.add_context_artifacts_and_executions.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.add_context_children.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.add_execution_events.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.create_artifact.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.create_context.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.create_execution.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.create_metadata_schema.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.create_metadata_store.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.delete_artifact.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.delete_context.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.delete_execution.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.delete_metadata_store.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.get_artifact.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.get_context.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.get_execution.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.get_metadata_schema.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.get_metadata_store.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.list_artifacts.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.list_contexts.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.list_executions.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.list_metadata_schemas.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.list_metadata_stores.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.purge_artifacts.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.purge_contexts.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.purge_executions.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.query_artifact_lineage_subgraph.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.query_context_lineage_subgraph.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.query_execution_inputs_and_outputs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.remove_context_children.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.update_artifact.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.update_context.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/metadata_service.update_execution.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/migration_service.batch_migrate_resources.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/migration_service.search_migratable_resources.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.batch_import_evaluated_annotations.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.batch_import_model_evaluation_slices.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.copy_model.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.delete_model.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.delete_model_version.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.export_model.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.get_model.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.get_model_evaluation.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.get_model_evaluation_slice.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.import_model_evaluation.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.list_model_evaluation_slices.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.list_model_evaluations.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.list_model_versions.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.list_models.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.merge_version_aliases.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.update_explanation_dataset.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.update_model.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/model_service.upload_model.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.cancel_pipeline_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.cancel_training_pipeline.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.create_pipeline_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.create_training_pipeline.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.delete_pipeline_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.delete_training_pipeline.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.get_pipeline_job.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.get_training_pipeline.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.list_pipeline_jobs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/pipeline_service.list_training_pipelines.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/prediction_service.explain.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/prediction_service.predict.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/prediction_service.raw_predict.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/schedule_service.create_schedule.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/schedule_service.delete_schedule.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/schedule_service.get_schedule.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/schedule_service.list_schedules.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/schedule_service.pause_schedule.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/schedule_service.resume_schedule.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/specialist_pool_service.create_specialist_pool.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/specialist_pool_service.delete_specialist_pool.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/specialist_pool_service.get_specialist_pool.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/specialist_pool_service.list_specialist_pools.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/specialist_pool_service.update_specialist_pool.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_runs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_time_series.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.batch_read_tensorboard_time_series_data.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.create_tensorboard.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.create_tensorboard_experiment.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.create_tensorboard_run.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.create_tensorboard_time_series.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.delete_tensorboard.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_experiment.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_run.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_time_series.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.get_tensorboard.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.get_tensorboard_experiment.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.get_tensorboard_run.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.get_tensorboard_time_series.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.list_tensorboard_experiments.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.list_tensorboard_runs.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.list_tensorboard_time_series.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.list_tensorboards.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.read_tensorboard_blob_data.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.read_tensorboard_time_series_data.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.read_tensorboard_usage.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.update_tensorboard.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.update_tensorboard_experiment.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.update_tensorboard_run.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.update_tensorboard_time_series.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.write_tensorboard_experiment_data.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/tensorboard_service.write_tensorboard_run_data.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.add_trial_measurement.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.complete_trial.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.create_study.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.create_trial.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.delete_study.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.delete_trial.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.get_study.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.get_trial.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.list_optimal_trials.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.list_studies.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.list_trials.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.lookup_study.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.stop_trial.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/vizier_service.suggest_trials.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_dataset_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_deployment_resource_pool_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_endpoint_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_job_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_match_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_metadata_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_migration_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_model_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_pipeline_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_prediction_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_schedule_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_tensorboard_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_vizier_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-aiplatform/v1beta1/webpack.config.js rename {owl-bot-staging/google-cloud-aiplatform/v1 => packages/google-cloud-aiplatform}/samples/generated/v1/endpoint_service.mutate_deployed_model.js (100%) rename {owl-bot-staging/google-cloud-aiplatform/v1beta1 => packages/google-cloud-aiplatform}/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js (100%) diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/.eslintignore b/owl-bot-staging/google-cloud-aiplatform/v1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/.eslintrc.json b/owl-bot-staging/google-cloud-aiplatform/v1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/.gitignore b/owl-bot-staging/google-cloud-aiplatform/v1/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/.jsdoc.js b/owl-bot-staging/google-cloud-aiplatform/v1/.jsdoc.js deleted file mode 100644 index c805f17d6a9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 2023 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/aiplatform', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/.mocharc.js b/owl-bot-staging/google-cloud-aiplatform/v1/.mocharc.js deleted file mode 100644 index 1a38f257db7..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/google-cloud-aiplatform/v1/.prettierrc.js b/owl-bot-staging/google-cloud-aiplatform/v1/.prettierrc.js deleted file mode 100644 index 55639e70f9e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/google-cloud-aiplatform/v1/README.md b/owl-bot-staging/google-cloud-aiplatform/v1/README.md deleted file mode 100644 index 7f057918e1b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Aiplatform: Nodejs Client diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/linkinator.config.json b/owl-bot-staging/google-cloud-aiplatform/v1/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/package.json b/owl-bot-staging/google-cloud-aiplatform/v1/package.json deleted file mode 100644 index fd49b56f91c..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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.7" - }, - "devDependencies": { - "@types/mocha": "^10.0.1", - "@types/node": "^18.11.18", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^4.0.0", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.1.2", - "mocha": "^10.2.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^15.0.1", - "ts-loader": "^8.4.0", - "typescript": "^4.8.4", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/accelerator_type.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/accelerator_type.proto deleted file mode 100644 index f06cfb9df9e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/accelerator_type.proto +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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; - - // Nvidia L4 GPU. - NVIDIA_L4 = 11; - - // TPU v2. - TPU_V2 = 6; - - // TPU v3. - TPU_V3 = 7; - - // TPU v4. - TPU_V4_POD = 10; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/annotation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/annotation.proto deleted file mode 100644 index 2a9a0cca69c..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/annotation.proto +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/annotation_spec.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/annotation_spec.proto deleted file mode 100644 index fbb8094325b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/annotation_spec.proto +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/artifact.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/artifact.proto deleted file mode 100644 index 77ba15c1c50..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/artifact.proto +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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. - // Top level metadata keys' heading and trailing spaces will be trimmed. - // 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto deleted file mode 100644 index 5388cd02886..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto +++ /dev/null @@ -1,455 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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]; - } - - // Configuration defining how to transform batch prediction input instances to - // the instances that the Model accepts. - message InstanceConfig { - // The format of the instance that the Model accepts. Vertex AI will - // convert compatible - // [batch prediction input instance - // formats][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.instances_format] - // to the specified format. - // - // Supported values are: - // - // * `object`: Each input is converted to JSON object format. - // * For `bigquery`, each row is converted to an object. - // * For `jsonl`, each line of the JSONL input must be an object. - // * Does not apply to `csv`, `file-list`, `tf-record`, or - // `tf-record-gzip`. - // - // * `array`: Each input is converted to JSON array format. - // * For `bigquery`, each row is converted to an array. The order - // of columns is determined by the BigQuery column order, unless - // [included_fields][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.included_fields] - // is populated. - // [included_fields][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.included_fields] - // must be populated for specifying field orders. - // * For `jsonl`, if each line of the JSONL input is an object, - // [included_fields][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.included_fields] - // must be populated for specifying field orders. - // * Does not apply to `csv`, `file-list`, `tf-record`, or - // `tf-record-gzip`. - // - // If not specified, Vertex AI converts the batch prediction input as - // follows: - // - // * For `bigquery` and `csv`, the behavior is the same as `array`. The - // order of columns is the same as defined in the file or table, unless - // [included_fields][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.included_fields] - // is populated. - // * For `jsonl`, the prediction instance format is determined by - // each line of the input. - // * For `tf-record`/`tf-record-gzip`, each record will be converted to - // an object in the format of `{"b64": }`, where `` is - // the Base64-encoded string of the content of the record. - // * For `file-list`, each file in the list will be converted to an - // object in the format of `{"b64": }`, where `` is - // the Base64-encoded string of the content of the file. - string instance_type = 1; - - // The name of the field that is considered as a key. - // - // The values identified by the key field is not included in the transformed - // instances that is sent to the Model. This is similar to - // specifying this name of the field in - // [excluded_fields][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.excluded_fields]. - // In addition, the batch prediction output will not include the instances. - // Instead the output will only include the value of the key field, in a - // field named `key` in the output: - // - // * For `jsonl` output format, the output will have a `key` field - // instead of the `instance` field. - // * For `csv`/`bigquery` output format, the output will have have a `key` - // column instead of the instance feature columns. - // - // The input must be JSONL with objects at each line, CSV, BigQuery - // or TfRecord. - string key_field = 2; - - // Fields that will be included in the prediction instance that is - // sent to the Model. - // - // If - // [instance_type][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.instance_type] - // is `array`, the order of field names in included_fields also determines - // the order of the values in the array. - // - // When included_fields is populated, - // [excluded_fields][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.excluded_fields] - // must be empty. - // - // The input must be JSONL with objects at each line, CSV, BigQuery - // or TfRecord. - repeated string included_fields = 3; - - // Fields that will be excluded in the prediction instance that is - // sent to the Model. - // - // Excluded will be attached to the batch prediction output if - // [key_field][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.key_field] - // is not specified. - // - // When excluded_fields is populated, - // [included_fields][google.cloud.aiplatform.v1.BatchPredictionJob.InstanceConfig.included_fields] - // must be empty. - // - // The input must be JSONL with objects at each line, CSV, BigQuery - // or TfRecord. - repeated string excluded_fields = 4; - } - - // 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 resource 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. - // Example: `projects/{project}/locations/{location}/models/{model}@2` - // or - // `projects/{project}/locations/{location}/models/{model}@golden` - // if no version is specified, the default version will be deployed. - 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]; - - // Configuration for how to convert batch prediction input instances to the - // prediction instances that are sent to the Model. - InstanceConfig instance_config = 27; - - // 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; - - // 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 Google Cloud 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.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 Google Cloud 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; - - // For custom-trained Models and AutoML Tabular Models, the container of the - // DeployedModel instances will send `stderr` and `stdout` streams to - // Cloud Logging by default. Please note that the logs incur cost, - // which are subject to [Cloud Logging - // pricing](https://cloud.google.com/logging/pricing). - // - // User can disable container logging by setting this flag to true. - bool disable_container_logging = 34; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto deleted file mode 100644 index 033c13f8a63..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/context.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/context.proto deleted file mode 100644 index dfbf62d3065..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/context.proto +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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. - // Top level metadata keys' heading and trailing spaces will be trimmed. - // 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/custom_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/custom_job.proto deleted file mode 100644 index 10be55ef321..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/custom_job.proto +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 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. -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]; - - // Optional. Whether you want Vertex AI to enable access to the customized - // dashboard in training chief container. - // - // If set to `true`, you can access the dashboard 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_dashboard_access = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Experiment associated with this job. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadataStores}/contexts/{experiment-name}` - string experiment = 17 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - } - ]; - - // Optional. The Experiment Run associated with this job. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadataStores}/contexts/{experiment-name}-{experiment-run-name}` - string experiment_run = 18 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - } - ]; -} - -// 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/data_item.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/data_item.proto deleted file mode 100644 index e8a936b0796..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/data_item.proto +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/data_labeling_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/data_labeling_job.proto deleted file mode 100644 index afcc035396e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/data_labeling_job.proto +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/dataset.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/dataset.proto deleted file mode 100644 index bca97b5b9d0..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/dataset.proto +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/saved_query.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // The description of the Dataset. - string description = 16; - - // 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; - - // All SavedQueries belong to the Dataset will be returned in List/Get - // Dataset response. The annotation_specs field - // will not be populated except for UI cases which will only use - // [annotation_spec_count][google.cloud.aiplatform.v1.SavedQuery.annotation_spec_count]. - // In CreateDataset request, a SavedQuery is created together if - // this field is set, up to one SavedQuery can be set in CreateDatasetRequest. - // The SavedQuery should not contain any AnnotationSpec. - repeated SavedQuery saved_queries = 9; - - // 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; - - // Output only. The resource name of the Artifact that was created in - // MetadataStore when creating the Dataset. The Artifact resource name pattern - // is - // `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`. - string metadata_artifact = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// 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; - - // Labels that will be applied to newly imported Annotations. If two - // Annotations are identical, one of them will be deduped. Two Annotations are - // considered identical if their - // [payload][google.cloud.aiplatform.v1.Annotation.payload], - // [payload_schema_uri][google.cloud.aiplatform.v1.Annotation.payload_schema_uri] - // and all of their [labels][google.cloud.aiplatform.v1.Annotation.labels] are - // the same. 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 annotation_labels = 3; - - // 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; - } - - // The instructions how the export data should be split between the - // training, validation and test sets. - oneof split { - // Split based on fractions defining the size of each set. - ExportFractionSplit fraction_split = 5; - } - - // An expression for filtering what part of the Dataset is to be exported. - // Only Annotations 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; -} - -// Assigns the input data to training, validation, and test sets as per the -// given fractions. Any of `training_fraction`, `validation_fraction` and -// `test_fraction` may optionally be provided, they must sum to up to 1. If the -// provided ones sum to less than 1, the remainder is assigned to sets as -// decided by Vertex AI. If none of the fractions are set, by default roughly -// 80% of data is used for training, 10% for validation, and 10% for test. -message ExportFractionSplit { - // The fraction of the input data that is to be used to train the Model. - double training_fraction = 1; - - // The fraction of the input data that is to be used to validate the Model. - double validation_fraction = 2; - - // The fraction of the input data that is to be used to evaluate the Model. - double test_fraction = 3; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto deleted file mode 100644 index 51f8e410404..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto +++ /dev/null @@ -1,631 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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"; - } - - // Searches DataItems in a Dataset. - rpc SearchDataItems(SearchDataItemsRequest) - returns (SearchDataItemsResponse) { - option (google.api.http) = { - get: "/v1/{dataset=projects/*/locations/*/datasets/*}:searchDataItems" - }; - } - - // 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.SearchDataItems][google.cloud.aiplatform.v1.DatasetService.SearchDataItems]. -message SearchDataItemsRequest { - // Expression that allows ranking results based on annotation's property. - message OrderByAnnotation { - // Required. Saved query of the Annotation. Only Annotations belong to this - // saved query will be considered for ordering. - string saved_query = 1 [(google.api.field_behavior) = REQUIRED]; - - // A comma-separated list of annotation fields to order by, sorted in - // ascending order. Use "desc" after a field name for descending. Must also - // specify saved_query. - string order_by = 2; - } - - oneof order { - // A comma-separated list of data item fields to order by, sorted in - // ascending order. Use "desc" after a field name for descending. - string order_by_data_item = 12; - - // Expression that allows ranking results based on annotation's property. - OrderByAnnotation order_by_annotation = 13; - } - - // Required. The resource name of the Dataset from which to search DataItems. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}` - string dataset = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - } - ]; - - // The resource name of a SavedQuery(annotation set in UI). - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` - // All of the search will be done in the context of this SavedQuery. - string saved_query = 2 [ - deprecated = true, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/SavedQuery" - } - ]; - - // The resource name of a DataLabelingJob. - // Format: - // `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - // If this field is set, all of the search will be done in the context of - // this DataLabelingJob. - string data_labeling_job = 3; - - // An expression for filtering the DataItem that will be returned. - // - // * `data_item_id` - for = or !=. - // * `labeled` - for = or !=. - // * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that - // have at least one annotation with annotation_spec_id = - // `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. - // - // For example: - // - // * `data_item=1` - // * `has_annotation(5)` - string data_item_filter = 4; - - // An expression for filtering the Annotations that will be returned per - // DataItem. - // * `annotation_spec_id` - for = or !=. - string annotations_filter = 5 [deprecated = true]; - - // An expression that specifies what Annotations will be returned per - // DataItem. Annotations satisfied either of the conditions will be returned. - // * `annotation_spec_id` - for = or !=. - // Must specify `saved_query_id=` - saved query id that annotations should - // belong to. - repeated string annotation_filters = 11; - - // Mask specifying which fields of - // [DataItemView][google.cloud.aiplatform.v1.DataItemView] to read. - google.protobuf.FieldMask field_mask = 6; - - // If set, only up to this many of Annotations will be returned per - // DataItemView. The maximum value is 1000. If not set, the maximum value will - // be used. - int32 annotations_limit = 7; - - // Requested page size. Server may return fewer results than requested. - // Default and maximum page size is 100. - int32 page_size = 8; - - // A comma-separated list of fields to order by, sorted in ascending order. - // Use "desc" after a field name for descending. - string order_by = 9 [deprecated = true]; - - // A token identifying a page of results for the server to return - // Typically obtained via - // [SearchDataItemsResponse.next_page_token][google.cloud.aiplatform.v1.SearchDataItemsResponse.next_page_token] - // of the previous - // [DatasetService.SearchDataItems][google.cloud.aiplatform.v1.DatasetService.SearchDataItems] - // call. - string page_token = 10; -} - -// Response message for -// [DatasetService.SearchDataItems][google.cloud.aiplatform.v1.DatasetService.SearchDataItems]. -message SearchDataItemsResponse { - // The DataItemViews read. - repeated DataItemView data_item_views = 1; - - // A token to retrieve next page of results. - // Pass to - // [SearchDataItemsRequest.page_token][google.cloud.aiplatform.v1.SearchDataItemsRequest.page_token] - // to obtain that page. - string next_page_token = 2; -} - -// A container for a single DataItem and Annotations on it. -message DataItemView { - // The DataItem. - DataItem data_item = 1; - - // The Annotations on the DataItem. If too many Annotations should be returned - // for the DataItem, this field will be truncated per annotations_limit in - // request. If it was, then the has_truncated_annotations will be set to true. - repeated Annotation annotations = 2; - - // True if and only if the Annotations field has been truncated. It happens if - // more Annotations for this DataItem met the request's annotation_filter than - // are allowed to be returned by annotations_limit. - // Note that if Annotations field is not being returned due to field mask, - // then this field will not be set to true no matter how many Annotations are - // there. - bool has_truncated_annotations = 3; -} - -// 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/deployed_index_ref.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/deployed_index_ref.proto deleted file mode 100644 index 5049c83b1b5..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/deployed_index_ref.proto +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/deployed_model_ref.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/deployed_model_ref.proto deleted file mode 100644 index c5b9bba39b5..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/deployed_model_ref.proto +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/encryption_spec.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/encryption_spec.proto deleted file mode 100644 index a8a73291a8d..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/encryption_spec.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/endpoint.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/endpoint.proto deleted file mode 100644 index e014e10611f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/endpoint.proto +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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}" - pattern: "projects/{project}/locations/{location}/publishers/{publisher}/models/{model}" - }; - - // 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 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; - - // Optional. 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.field_behavior) = OPTIONAL, - (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 - // [JobService.CreateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.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]. - // Required except for Large Model Deploy use cases. - 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. - // Example: `projects/{project}/locations/{location}/models/{model}@2` - // or - // `projects/{project}/locations/{location}/models/{model}@golden` - // 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 - // Cloud Logging by default. Please note that the logs incur cost, - // which are subject to [Cloud Logging - // pricing](https://cloud.google.com/logging/pricing). - // - // User can disable container logging by setting this flag to true. - bool disable_container_logging = 15; - - // If true, online prediction access logs are sent to Cloud - // Logging. - // These logs are like standard server access logs, containing - // information like timestamp and latency for each prediction request. - // - // Note that 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/endpoint_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/endpoint_service.proto deleted file mode 100644 index 6ac193dabf8..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/endpoint_service.proto +++ /dev/null @@ -1,425 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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" - }; - } - - // Updates an existing deployed model. Updatable fields include - // `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, - // `disable_container_logging` (v1 only), and `enable_container_logging` - // (v1beta1 only). - rpc MutateDeployedModel(MutateDeployedModelRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:mutateDeployedModel" - body: "*" - }; - option (google.api.method_signature) = - "endpoint,deployed_model,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "MutateDeployedModelResponse" - metadata_type: "MutateDeployedModelOperationMetadata" - }; - } -} - -// 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. - // - // If the first character is a letter, this value may be up to 63 characters, - // and valid characters are `[a-z0-9-]`. The last character must be a letter - // or number. - // - // If the first character is a number, this value may be up to 9 characters, - // and valid characters are `[0-9]` with no leading zeros. - // - // 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; -} - -// Request message for -// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1.EndpointService.MutateDeployedModel]. -message MutateDeployedModelRequest { - // Required. The name of the Endpoint resource into which to mutate a - // DeployedModel. 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 mutated within the Endpoint. Only the - // following fields can be mutated: - // - // * `min_replica_count` in either - // [DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources] or - // [AutomaticResources][google.cloud.aiplatform.v1.AutomaticResources] - // * `max_replica_count` in either - // [DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources] or - // [AutomaticResources][google.cloud.aiplatform.v1.AutomaticResources] - // * [autoscaling_metric_specs][google.cloud.aiplatform.v1.DedicatedResources.autoscaling_metric_specs] - // * `disable_container_logging` (v1 only) - // * `enable_container_logging` (v1beta1 only) - DeployedModel deployed_model = 2 [(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 = 4 - [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for -// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1.EndpointService.MutateDeployedModel]. -message MutateDeployedModelResponse { - // The DeployedModel that's being mutated. - DeployedModel deployed_model = 1; -} - -// Runtime operation information for -// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1.EndpointService.MutateDeployedModel]. -message MutateDeployedModelOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/entity_type.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/entity_type.proto deleted file mode 100644 index 8e70ea2a37f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/entity_type.proto +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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]; - - // Optional. Config for data retention policy in offline storage. - // TTL in days for feature values that will be stored in offline storage. - // The Feature Store offline storage periodically removes obsolete feature - // values older than `offline_storage_ttl_days` since the feature generation - // time. If unset (or explicitly set to 0), default to 4000 days TTL. - int32 offline_storage_ttl_days = 10 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/env_var.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/env_var.proto deleted file mode 100644 index b548757213c..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/env_var.proto +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/evaluated_annotation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/evaluated_annotation.proto deleted file mode 100644 index 2d74effd981..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/evaluated_annotation.proto +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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.proto"; -import "google/protobuf/struct.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -option java_multiple_files = true; -option java_outer_classname = "EvaluatedAnnotationProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// True positive, false positive, or false negative. -// -// EvaluatedAnnotation is only available under ModelEvaluationSlice with slice -// of `annotationSpec` dimension. -message EvaluatedAnnotation { - // Describes the type of the EvaluatedAnnotation. The type is determined - enum EvaluatedAnnotationType { - // Invalid value. - EVALUATED_ANNOTATION_TYPE_UNSPECIFIED = 0; - - // The EvaluatedAnnotation is a true positive. It has a prediction created - // by the Model and a ground truth Annotation which the prediction matches. - TRUE_POSITIVE = 1; - - // The EvaluatedAnnotation is false positive. It has a prediction created by - // the Model which does not match any ground truth annotation. - FALSE_POSITIVE = 2; - - // The EvaluatedAnnotation is false negative. It has a ground truth - // annotation which is not matched by any of the model created predictions. - FALSE_NEGATIVE = 3; - } - - // Output only. Type of the EvaluatedAnnotation. - EvaluatedAnnotationType type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The model predicted annotations. - // - // For true positive, there is one and only one prediction, which matches the - // only one ground truth annotation in - // [ground_truths][google.cloud.aiplatform.v1.EvaluatedAnnotation.ground_truths]. - // - // For false positive, there is one and only one prediction, which doesn't - // match any ground truth annotation of the corresponding - // [data_item_view_id][EvaluatedAnnotation.data_item_view_id]. - // - // For false negative, there are zero or more predictions which are similar to - // the only ground truth annotation in - // [ground_truths][google.cloud.aiplatform.v1.EvaluatedAnnotation.ground_truths] - // but not enough for a match. - // - // The schema of the prediction is stored in - // [ModelEvaluation.annotation_schema_uri][google.cloud.aiplatform.v1.ModelEvaluation.annotation_schema_uri] - repeated google.protobuf.Value predictions = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The ground truth Annotations, i.e. the Annotations that exist - // in the test data the Model is evaluated on. - // - // For true positive, there is one and only one ground truth annotation, which - // matches the only prediction in - // [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions]. - // - // For false positive, there are zero or more ground truth annotations that - // are similar to the only prediction in - // [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions], - // but not enough for a match. - // - // For false negative, there is one and only one ground truth annotation, - // which doesn't match any predictions created by the model. - // - // The schema of the ground truth is stored in - // [ModelEvaluation.annotation_schema_uri][google.cloud.aiplatform.v1.ModelEvaluation.annotation_schema_uri] - repeated google.protobuf.Value ground_truths = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The data item payload that the Model predicted this - // EvaluatedAnnotation on. - google.protobuf.Value data_item_payload = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. ID of the EvaluatedDataItemView under the same ancestor - // ModelEvaluation. The EvaluatedDataItemView consists of all ground truths - // and predictions on - // [data_item_payload][google.cloud.aiplatform.v1.EvaluatedAnnotation.data_item_payload]. - string evaluated_data_item_view_id = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Explanations of - // [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions]. - // Each element of the explanations indicates the explanation for one - // explanation Method. - // - // The attributions list in the - // [EvaluatedAnnotationExplanation.explanation][google.cloud.aiplatform.v1.EvaluatedAnnotationExplanation.explanation] - // object corresponds to the - // [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions] - // list. For example, the second element in the attributions list explains the - // second element in the predictions list. - repeated EvaluatedAnnotationExplanation explanations = 8; - - // Annotations of model error analysis results. - repeated ErrorAnalysisAnnotation error_analysis_annotations = 9; -} - -// Explanation result of the prediction produced by the Model. -message EvaluatedAnnotationExplanation { - // Explanation type. - // - // For AutoML Image Classification models, possible values are: - // - // * `image-integrated-gradients` - // * `image-xrai` - string explanation_type = 1; - - // Explanation attribution response details. - Explanation explanation = 2; -} - -// Model error analysis for each annotation. -message ErrorAnalysisAnnotation { - // Attributed items for a given annotation, typically representing neighbors - // from the training sets constrained by the query type. - message AttributedItem { - // The unique ID for each annotation. Used by FE to allocate the annotation - // in DB. - string annotation_resource_name = 1; - - // The distance of this item to the annotation. - double distance = 2; - } - - // The query type used for finding the attributed items. - enum QueryType { - // Unspecified query type for model error analysis. - QUERY_TYPE_UNSPECIFIED = 0; - - // Query similar samples across all classes in the dataset. - ALL_SIMILAR = 1; - - // Query similar samples from the same class of the input sample. - SAME_CLASS_SIMILAR = 2; - - // Query dissimilar samples from the same class of the input sample. - SAME_CLASS_DISSIMILAR = 3; - } - - // Attributed items for a given annotation, typically representing neighbors - // from the training sets constrained by the query type. - repeated AttributedItem attributed_items = 1; - - // The query type used for finding the attributed items. - QueryType query_type = 2; - - // The outlier score of this annotated item. Usually defined as the min of all - // distances from attributed items. - double outlier_score = 3; - - // The threshold used to determine if this annotation is an outlier or not. - double outlier_threshold = 4; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/event.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/event.proto deleted file mode 100644 index 65e9d7a09b3..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/event.proto +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/execution.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/execution.proto deleted file mode 100644 index 915c58dae7b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/execution.proto +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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. - // Top level metadata keys' heading and trailing spaces will be trimmed. - // 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/explanation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/explanation.proto deleted file mode 100644 index c1e3545c9c4..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/explanation.proto +++ /dev/null @@ -1,501 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 - // attribution 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/explanation_metadata.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/explanation_metadata.proto deleted file mode 100644 index 45f24d3a7f7..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/explanation_metadata.proto +++ /dev/null @@ -1,423 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature.proto deleted file mode 100644 index 327ec57d301..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature.proto +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 - // [SnapshotAnalysis][google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.SnapshotAnalysis] - // or - // [ImportFeaturesAnalysis][google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ImportFeaturesAnalysis] - // 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto deleted file mode 100644 index c1828a72650..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature_selector.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature_selector.proto deleted file mode 100644 index 9f6ff203a2d..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/feature_selector.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore.proto deleted file mode 100644 index bcaf8ac3e91..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore.proto +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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; - - // Optional. The cpu utilization that the Autoscaler should be trying to - // achieve. This number is on a scale from 0 (no utilization) to 100 - // (total utilization), and is limited between 10 and 80. When a cluster's - // CPU utilization exceeds the target that you have set, Bigtable - // immediately adds nodes to the cluster. When CPU utilization is - // substantially lower than the target, Bigtable removes nodes. If not set - // or set to 0, default to 50. - int32 cpu_utilization_target = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // 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. The field should not - // co-exist with the field of `OnlineStoreReplicationConfig`. If both of it - // and OnlineStoreReplicationConfig are unset, the feature store 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. TTL in days for feature values that will be stored in online - // serving storage. The Feature Store online storage periodically removes - // obsolete feature values older than `online_storage_ttl_days` since the - // feature generation time. Note that `online_storage_ttl_days` should be less - // than or equal to `offline_storage_ttl_days` for each EntityType under a - // featurestore. If not set, default to 4000 days - int32 online_storage_ttl_days = 13 [(google.api.field_behavior) = OPTIONAL]; - - // 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto deleted file mode 100644 index a169e6c7144..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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. - 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][google.cloud.aiplatform.v1.FeaturestoreService.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][google.cloud.aiplatform.v1.FeaturestoreService.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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto deleted file mode 100644 index 6cc4e677546..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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"; - } - - // 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: "/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:writeFeatureValues" - body: "*" - }; - option (google.api.method_signature) = "entity_type,payloads"; - } -} - -// Request message for -// [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1.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.v1.FeaturestoreOnlineServingService.WriteFeatureValues]. -message WriteFeatureValuesResponse {} - -// 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.EntityView.data][google.cloud.aiplatform.v1.ReadFeatureValuesResponse.EntityView.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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto deleted file mode 100644 index 9249e3874ac..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto +++ /dev/null @@ -1,1444 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/type/interval.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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" - }; - } - - // Delete Feature values from Featurestore. - // - // The progress of the deletion is tracked by the returned operation. The - // deleted feature values are guaranteed to be invisible to subsequent read - // operations after the operation is marked as successfully done. - // - // If a delete feature values operation fails, the feature values - // returned from reads and exports may be inconsistent. If consistency is - // required, the caller must retry the same delete request again and wait till - // the new operation returned is marked as successfully done. - rpc DeleteFeatureValues(DeleteFeatureValuesRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:deleteFeatureValues" - body: "*" - }; - option (google.api.method_signature) = "entity_type"; - option (google.longrunning.operation_info) = { - response_type: "DeleteFeatureValuesResponse" - metadata_type: "DeleteFeatureValuesOperationMetadata" - }; - } - - // 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` - // * `online_storage_ttl_days` - 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; - - // The number rows that weren't ingested due to having feature timestamps - // outside the retention boundary. - int64 timestamp_outside_retention_rows_count = 4; -} - -// 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. - repeated EntityTypeSpec entity_type_specs = 7 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. 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 = 11 - [(google.api.field_behavior) = OPTIONAL]; -} - -// 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` - // * `offline_storage_ttl_days` - 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 128 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 source URI from where Feature values are imported. - repeated string source_uris = 4; - - // 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; - - // The number rows that weren't ingested due to having timestamps outside the - // retention boundary. - int64 timestamp_outside_retention_rows_count = 7; -} - -// 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 delete Feature values. -message DeleteFeatureValuesOperationMetadata { - // Operation metadata for Featurestore delete 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; -} - -// Request message for -// [FeaturestoreService.DeleteFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.DeleteFeatureValues]. -message DeleteFeatureValuesRequest { - // Message to select entity. - // If an entity id is selected, all the feature values corresponding to the - // entity id will be deleted, including the entityId. - message SelectEntity { - // Required. Selectors choosing feature values of which entity id to be - // deleted from the EntityType. - EntityIdSelector entity_id_selector = 1 - [(google.api.field_behavior) = REQUIRED]; - } - - // Message to select time range and feature. - // Values of the selected feature generated within an inclusive time range - // will be deleted. Using this option permanently deletes the feature values - // from the specified feature IDs within the specified time range. - // This might include data from the online storage. If you want to retain - // any deleted historical data in the online storage, you must re-ingest it. - message SelectTimeRangeAndFeature { - // Required. Select feature generated within a half-inclusive time range. - // The time range is lower inclusive and upper exclusive. - google.type.Interval time_range = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. Selectors choosing which feature values to be deleted from the - // EntityType. - FeatureSelector feature_selector = 2 - [(google.api.field_behavior) = REQUIRED]; - - // If set, data will not be deleted from online storage. - // When time range is older than the data in online storage, setting this to - // be true will make the deletion have no impact on online serving. - bool skip_online_storage_delete = 3; - } - - // Defines options to select feature values to be deleted. - oneof DeleteOption { - // Select feature values to be deleted by specifying entities. - SelectEntity select_entity = 2; - - // Select feature values to be deleted by specifying time range and - // features. - SelectTimeRangeAndFeature select_time_range_and_feature = 3; - } - - // Required. The resource name of the EntityType grouping the Features for - // which values are being deleted from. 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" - } - ]; -} - -// Response message for -// [FeaturestoreService.DeleteFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.DeleteFeatureValues]. -message DeleteFeatureValuesResponse { - // Response message if the request uses the SelectEntity option. - message SelectEntity { - // The count of deleted entity rows in the offline storage. - // Each row corresponds to the combination of an entity ID and a timestamp. - // One entity ID can have multiple rows in the offline storage. - int64 offline_storage_deleted_entity_row_count = 1; - - // The count of deleted entities in the online storage. - // Each entity ID corresponds to one entity. - int64 online_storage_deleted_entity_count = 2; - } - - // Response message if the request uses the SelectTimeRangeAndFeature option. - message SelectTimeRangeAndFeature { - // The count of the features or columns impacted. - // This is the same as the feature count in the request. - int64 impacted_feature_count = 1; - - // The count of modified entity rows in the offline storage. - // Each row corresponds to the combination of an entity ID and a timestamp. - // One entity ID can have multiple rows in the offline storage. - // Within each row, only the features specified in the request are - // deleted. - int64 offline_storage_modified_entity_row_count = 2; - - // The count of modified entities in the online storage. - // Each entity ID corresponds to one entity. - // Within each entity, only the features specified in the request are - // deleted. - int64 online_storage_modified_entity_count = 3; - } - - // Response based on which delete option is specified in the - // request - oneof response { - // Response for request specifying the entities to delete - SelectEntity select_entity = 1; - - // Response for request specifying time range and feature - SelectTimeRangeAndFeature select_time_range_and_feature = 2; - } -} - -// Selector for entityId. Getting ids from the given source. -message EntityIdSelector { - // Details about the source data, including the location of the storage and - // the format. - oneof EntityIdsSource { - // Source of Csv - CsvSource csv_source = 3; - } - - // Source column that holds entity IDs. If not provided, entity IDs are - // extracted from the column named `entity_id`. - string entity_id_field = 5; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto deleted file mode 100644 index 9699d36fcd4..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index.proto deleted file mode 100644 index 6f21672aa48..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index.proto +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_endpoint.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_endpoint.proto deleted file mode 100644 index 9b4dd453297..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_endpoint.proto +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/cloud/aiplatform/v1/service_networking.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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]; - - // Optional. Configuration for private service connect. - // - // [network][google.cloud.aiplatform.v1.IndexEndpoint.network] and - // [private_service_connect_config][google.cloud.aiplatform.v1.IndexEndpoint.private_service_connect_config] - // are mutually exclusive. - PrivateServiceConnectConfig private_service_connect_config = 12 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, the deployed index will be accessible through public - // endpoint. - bool public_endpoint_enabled = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. If - // [public_endpoint_enabled][google.cloud.aiplatform.v1.IndexEndpoint.public_endpoint_enabled] - // is true, this field will be populated with the domain name to use for this - // index endpoint. - string public_endpoint_domain_name = 14 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// 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 for SMALL shard: - // e2-standard-2 and all machine types available for MEDIUM and LARGE shard. - // - // Available machine types for MEDIUM shard: - // e2-standard-16 and all machine types available for LARGE shard. - // - // Available machine types for LARGE shard: - // e2-highmem-16, n2d-standard-32. - // - // n1-standard-16 and n1-standard-32 are still available, but we recommend - // e2-standard-16 and e2-highmem-16 for cost efficiency. - DedicatedResources dedicated_resources = 16 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, private endpoint's access logs are sent to Cloud - // Logging. - // - // These logs are like standard server access logs, containing - // information like timestamp and latency for each MatchRequest. - // - // Note that 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 should 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_endpoint_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_endpoint_service.proto deleted file mode 100644 index 36fb8e297ee..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_endpoint_service.proto +++ /dev/null @@ -1,362 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_service.proto deleted file mode 100644 index 29f10f47878..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/index_service.proto +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/io.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/io.proto deleted file mode 100644 index 016601d8658..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/io.proto +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/job_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/job_service.proto deleted file mode 100644 index a9feae428ba..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/job_service.proto +++ /dev/null @@ -1,1372 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/nas_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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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," - "https://www.googleapis.com/auth/cloud-platform.read-only"; - - // 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 NasJob - rpc CreateNasJob(CreateNasJobRequest) returns (NasJob) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/nasJobs" - body: "nas_job" - }; - option (google.api.method_signature) = "parent,nas_job"; - } - - // Gets a NasJob - rpc GetNasJob(GetNasJobRequest) returns (NasJob) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/nasJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists NasJobs in a Location. - rpc ListNasJobs(ListNasJobsRequest) returns (ListNasJobsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/nasJobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a NasJob. - rpc DeleteNasJob(DeleteNasJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/nasJobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Cancels a NasJob. - // Starts asynchronous cancellation on the NasJob. The server - // makes a best effort to cancel the job, but success is not - // guaranteed. Clients can use - // [JobService.GetNasJob][google.cloud.aiplatform.v1.JobService.GetNasJob] or - // other methods to check whether the cancellation succeeded or whether the - // job completed despite cancellation. On successful cancellation, - // the NasJob is not deleted; instead it becomes a job with - // a [NasJob.error][google.cloud.aiplatform.v1.NasJob.error] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`, and - // [NasJob.state][google.cloud.aiplatform.v1.NasJob.state] is set to - // `CANCELLED`. - rpc CancelNasJob(CancelNasJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/nasJobs/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Gets a NasTrialDetail. - rpc GetNasTrialDetail(GetNasTrialDetailRequest) returns (NasTrialDetail) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/nasJobs/*/nasTrialDetails/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List top NasTrialDetails of a NasJob. - rpc ListNasTrialDetails(ListNasTrialDetailsRequest) - returns (ListNasTrialDetailsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/nasJobs/*}/nasTrialDetails" - }; - option (google.api.method_signature) = "parent"; - } - - // 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. - // * `labels` supports general map functions that is: - // `labels.key=value` - key:value equality - // `labels.key:* - key existence - // - // 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"` - // * `labels.keyA=valueA` - // * `labels.keyB:*` - 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. - // * `labels` supports general map functions that is: - // `labels.key=value` - key:value equality - // `labels.key:* - key existence - // - // 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"` - // * `labels.keyA=valueA` - // * `labels.keyB:*` - 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. - // * `labels` supports general map functions that is: - // `labels.key=value` - key:value equality - // `labels.key:* - key existence - // - // 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"` - // * `labels.keyA=valueA` - // * `labels.keyB:*` - 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.CreateNasJob][google.cloud.aiplatform.v1.JobService.CreateNasJob]. -message CreateNasJobRequest { - // Required. The resource name of the Location to create the NasJob 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 NasJob to create. - NasJob nas_job = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [JobService.GetNasJob][google.cloud.aiplatform.v1.JobService.GetNasJob]. -message GetNasJobRequest { - // Required. The name of the NasJob resource. - // Format: - // `projects/{project}/locations/{location}/nasJobs/{nas_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/NasJob" - } - ]; -} - -// Request message for -// [JobService.ListNasJobs][google.cloud.aiplatform.v1.JobService.ListNasJobs]. -message ListNasJobsRequest { - // Required. The resource name of the Location to list the NasJobs - // 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. - // * `labels` supports general map functions that is: - // `labels.key=value` - key:value equality - // `labels.key:* - key existence - // - // 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"` - // * `labels.keyA=valueA` - // * `labels.keyB:*` - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListNasJobsResponse.next_page_token][google.cloud.aiplatform.v1.ListNasJobsResponse.next_page_token] - // of the previous - // [JobService.ListNasJobs][google.cloud.aiplatform.v1.JobService.ListNasJobs] - // call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for -// [JobService.ListNasJobs][google.cloud.aiplatform.v1.JobService.ListNasJobs] -message ListNasJobsResponse { - // List of NasJobs in the requested page. - // [NasJob.nas_job_output][google.cloud.aiplatform.v1.NasJob.nas_job_output] - // of the jobs will not be returned. - repeated NasJob nas_jobs = 1; - - // A token to retrieve the next page of results. - // Pass to - // [ListNasJobsRequest.page_token][google.cloud.aiplatform.v1.ListNasJobsRequest.page_token] - // to obtain that page. - string next_page_token = 2; -} - -// Request message for -// [JobService.DeleteNasJob][google.cloud.aiplatform.v1.JobService.DeleteNasJob]. -message DeleteNasJobRequest { - // Required. The name of the NasJob resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/nasJobs/{nas_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/NasJob" - } - ]; -} - -// Request message for -// [JobService.CancelNasJob][google.cloud.aiplatform.v1.JobService.CancelNasJob]. -message CancelNasJobRequest { - // Required. The name of the NasJob to cancel. - // Format: - // `projects/{project}/locations/{location}/nasJobs/{nas_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/NasJob" - } - ]; -} - -// Request message for -// [JobService.GetNasTrialDetail][google.cloud.aiplatform.v1.JobService.GetNasTrialDetail]. -message GetNasTrialDetailRequest { - // Required. The name of the NasTrialDetail resource. - // Format: - // `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/NasTrialDetail" - } - ]; -} - -// Request message for -// [JobService.ListNasTrialDetails][google.cloud.aiplatform.v1.JobService.ListNasTrialDetails]. -message ListNasTrialDetailsRequest { - // Required. The name of the NasJob resource. - // Format: - // `projects/{project}/locations/{location}/nasJobs/{nas_job}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/NasJob" - } - ]; - - // The standard list page size. - int32 page_size = 2; - - // The standard list page token. - // Typically obtained via - // [ListNasTrialDetailsResponse.next_page_token][google.cloud.aiplatform.v1.ListNasTrialDetailsResponse.next_page_token] - // of the previous - // [JobService.ListNasTrialDetails][google.cloud.aiplatform.v1.JobService.ListNasTrialDetails] - // call. - string page_token = 3; -} - -// Response message for -// [JobService.ListNasTrialDetails][google.cloud.aiplatform.v1.JobService.ListNasTrialDetails] -message ListNasTrialDetailsResponse { - // List of top NasTrials in the requested page. - repeated NasTrialDetail nas_trial_details = 1; - - // A token to retrieve the next page of results. - // Pass to - // [ListNasTrialDetailsRequest.page_token][google.cloud.aiplatform.v1.ListNasTrialDetailsRequest.page_token] - // to obtain that page. - string next_page_token = 2; -} - -// 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. - // * `labels` supports general map functions that is: - // `labels.key=value` - key:value equality - // `labels.key:* - key existence - // - // 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"` - // * `labels.keyA=valueA` - // * `labels.keyB:*` - 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 effect 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. - // * `labels` supports general map functions that is: - // `labels.key=value` - key:value equality - // `labels.key:* - key existence - // - // 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"` - // * `labels.keyA=valueA` - // * `labels.keyB:*` - 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/job_state.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/job_state.proto deleted file mode 100644 index e152ca74346..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/job_state.proto +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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. Only jobs in the `RUNNING` state can be updated. - // After updating, the job goes back to the `RUNNING` state. - JOB_STATE_UPDATING = 10; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/lineage_subgraph.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/lineage_subgraph.proto deleted file mode 100644 index 67a06d98a9a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/lineage_subgraph.proto +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/machine_resources.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/machine_resources.proto deleted file mode 100644 index ae19c491235..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/machine_resources.proto +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto deleted file mode 100644 index 6d5db1ea847..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_schema.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_schema.proto deleted file mode 100644 index 65f1bdb83e3..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_schema.proto +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_service.proto deleted file mode 100644 index 9c1bcb09a6b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_service.proto +++ /dev/null @@ -1,1389 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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"; - } - - // Remove a set of children contexts from a parent Context. If any of the - // child Contexts were NOT added to the parent Context, they are - // simply skipped. - rpc RemoveContextChildren(RemoveContextChildrenRequest) - returns (RemoveContextChildrenResponse) { - option (google.api.http) = { - post: "/v1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:removeContextChildren" - 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`). Maximum nested expression depth allowed - // is 5. - // - // For example: `display_name = "test" AND metadata.field1.bool_value = true`. - string filter = 4; - - // How the list of messages is ordered. Specify the values to order by and an - // ordering operation. The default sorting order is ascending. To specify - // descending order for a field, users append a " desc" suffix; for example: - // "foo desc, bar". - // Subfields are specified with a `.` character, such as foo.bar. - // see https://google.aip.dev/132#ordering for more details. - string order_by = 5; -} - -// 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`). Maximum nested expression depth allowed - // is 5. - // - // For example: `display_name = "test" AND metadata.field1.bool_value = true`. - string filter = 4; - - // How the list of messages is ordered. Specify the values to order by and an - // ordering operation. The default sorting order is ascending. To specify - // descending order for a field, users append a " desc" suffix; for example: - // "foo desc, bar". - // Subfields are specified with a `.` character, such as foo.bar. - // see https://google.aip.dev/132#ordering for more details. - string order_by = 5; -} - -// 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.DeleteContextChildrenRequest][]. -message RemoveContextChildrenRequest { - // 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.RemoveContextChildren][google.cloud.aiplatform.v1.MetadataService.RemoveContextChildren]. -message RemoveContextChildrenResponse {} - -// 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`). Maximum nested expression depth allowed - // is 5. - // - // For example: `display_name = "test" AND metadata.field1.bool_value = true`. - string filter = 4; - - // How the list of messages is ordered. Specify the values to order by and an - // ordering operation. The default sorting order is ascending. To specify - // descending order for a field, users append a " desc" suffix; for example: - // "foo desc, bar". - // Subfields are specified with a `.` character, such as foo.bar. - // see https://google.aip.dev/132#ordering for more details. - string order_by = 5; -} - -// 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`). Maximum nested expression depth allowed - // is 5. - // - // For example: `display_name = "test" AND metadata.field1.bool_value = true`. - string filter = 3; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_store.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_store.proto deleted file mode 100644 index a2f38308cb6..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/metadata_store.proto +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/migratable_resource.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/migratable_resource.proto deleted file mode 100644 index 89108524992..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/migratable_resource.proto +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/migration_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/migration_service.proto deleted file mode 100644 index 41605fa1f2e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/migration_service.proto +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model.proto deleted file mode 100644 index 4872249c54a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model.proto +++ /dev/null @@ -1,715 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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]; - } - - // Contains information about the original Model if this Model is a copy. - message OriginalModelInfo { - // Output only. The resource name of the Model this Model is a copy of, - // including the revision. Format: - // `projects/{project}/locations/{location}/models/{model_id}@{version_id}` - string model = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - } - - // 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 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 or Large 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 or Large 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][google.cloud.aiplatform.v1.PredictionService.Explain] after - // being [deployed][google.cloud.aiplatform.v1.EndpointService.DeployModel] if - // it is populated. The Model can be used for [batch - // explanation][google.cloud.aiplatform.v1.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][google.cloud.aiplatform.v1.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][google.cloud.aiplatform.v1.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; - - // Output only. Source of a model. It can either be automl training pipeline, - // custom training pipeline, BigQuery ML, or existing Vertex AI Model. - ModelSourceInfo model_source_info = 38 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If this Model is a copy of another Model, this contains info - // about the original. - OriginalModelInfo original_model_info = 34 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The resource name of the Artifact that was created in - // MetadataStore when creating the Model. The Artifact resource name pattern - // is - // `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`. - string metadata_artifact = 44 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// 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; -} - -// Detail description of the source information of the model. -message ModelSourceInfo { - // Source of the model. - enum ModelSourceType { - // Should not be used. - MODEL_SOURCE_TYPE_UNSPECIFIED = 0; - - // The Model is uploaded by automl training pipeline. - AUTOML = 1; - - // The Model is uploaded by user or custom training pipeline. - CUSTOM = 2; - - // The Model is registered and sync'ed from BigQuery ML. - BQML = 3; - - // The Model is saved or tuned from Model Garden. - MODEL_GARDEN = 4; - - // The Model is saved or tuned from Genie. - GENIE = 5; - } - - // Type of the model source. - ModelSourceType source_type = 1; - - // If this Model is copy of another Model. If true then - // [source_type][google.cloud.aiplatform.v1.ModelSourceInfo.source_type] - // pertains to the original. - bool copy = 2; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto deleted file mode 100644 index bfd4768385b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_evaluation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_evaluation.proto deleted file mode 100644 index 6114518bf04..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_evaluation.proto +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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][google.cloud.aiplatform.v1.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][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions], - // and - // [EvaluatedAnnotation.ground_truths][google.cloud.aiplatform.v1.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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto deleted file mode 100644 index 059a3abdd47..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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"; -import "google/protobuf/wrappers.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 { - // Specification for how the data should be sliced. - message SliceSpec { - // Specification message containing the config for this SliceSpec. - // When `kind` is selected as `value` and/or `range`, only a single slice - // will be computed. - // When `all_values` is present, a separate slice will be computed for - // each possible label/value for the corresponding key in `config`. - // Examples, with feature zip_code with values 12345, 23334, 88888 and - // feature country with values "US", "Canada", "Mexico" in the dataset: - // - // Example 1: - // - // { - // "zip_code": { "value": { "float_value": 12345.0 } } - // } - // - // A single slice for any data with zip_code 12345 in the dataset. - // - // Example 2: - // - // { - // "zip_code": { "range": { "low": 12345, "high": 20000 } } - // } - // - // A single slice containing data where the zip_codes between 12345 and - // 20000 For this example, data with the zip_code of 12345 will be in this - // slice. - // - // Example 3: - // - // { - // "zip_code": { "range": { "low": 10000, "high": 20000 } }, - // "country": { "value": { "string_value": "US" } } - // } - // - // A single slice containing data where the zip_codes between 10000 and - // 20000 has the country "US". For this example, data with the zip_code of - // 12345 and country "US" will be in this slice. - // - // Example 4: - // - // { "country": {"all_values": { "value": true } } } - // - // Three slices are computed, one for each unique country in the dataset. - // - // Example 5: - // - // { - // "country": { "all_values": { "value": true } }, - // "zip_code": { "value": { "float_value": 12345.0 } } - // } - // - // Three slices are computed, one for each unique country in the dataset - // where the zip_code is also 12345. For this example, data with zip_code - // 12345 and country "US" will be in one slice, zip_code 12345 and country - // "Canada" in another slice, and zip_code 12345 and country "Mexico" in - // another slice, totaling 3 slices. - message SliceConfig { - oneof kind { - // A unique specific value for a given feature. - // Example: `{ "value": { "string_value": "12345" } }` - Value value = 1; - - // A range of values for a numerical feature. - // Example: `{"range":{"low":10000.0,"high":50000.0}}` - // will capture 12345 and 23334 in the slice. - Range range = 2; - - // If all_values is set to true, then all possible labels of the keyed - // feature will have another slice computed. - // Example: `{"all_values":{"value":true}}` - google.protobuf.BoolValue all_values = 3; - } - } - - // A range of values for slice(s). - // `low` is inclusive, `high` is exclusive. - message Range { - // Inclusive low value for the range. - float low = 1; - - // Exclusive high value for the range. - float high = 2; - } - - // Single value that supports strings and floats. - message Value { - oneof kind { - // String type. - string string_value = 1; - - // Float type. - float float_value = 2; - } - } - - // Mapping configuration for this SliceSpec. - // The key is the name of the feature. - // By default, the key will be prefixed by "instance" as a dictionary - // prefix for Vertex Batch Predictions output format. - map configs = 1; - } - - // 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]. - // * `slice`: This slice is a user customized slice defined by its - // SliceSpec. - 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. Specification for how the data was sliced. - SliceSpec slice_spec = 3 [(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]; - - // Output only. 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 tabular - // Models. - ModelExplanation model_explanation = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto deleted file mode 100644 index 1978accfb37..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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"; -option (google.api.resource_definition) = { - type: "monitoring.googleapis.com/NotificationChannel" - pattern: "projects/{project}/notificationChannels/{notification_channel}" -}; - -// 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_service.proto deleted file mode 100644 index 3ab66e345c0..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/model_service.proto +++ /dev/null @@ -1,870 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/encryption_spec.proto"; -import "google/cloud/aiplatform/v1/evaluated_annotation.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/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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][google.cloud.aiplatform.v1.DeployedModel] 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" - }; - } - - // Copies an already existing Vertex AI Model into the specified Location. - // The source Model must exist in the same Project. - // When copying custom Models, the users themselves are responsible for - // [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be - // region-agnostic, as well as making sure that any resources (e.g. files) it - // depends on remain accessible. - rpc CopyModel(CopyModelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/models:copy" - body: "*" - }; - option (google.api.method_signature) = "parent,source_model"; - option (google.longrunning.operation_info) = { - response_type: "CopyModelResponse" - metadata_type: "CopyModelOperationMetadata" - }; - } - - // 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"; - } - - // Imports a list of externally generated EvaluatedAnnotations. - rpc BatchImportEvaluatedAnnotations(BatchImportEvaluatedAnnotationsRequest) - returns (BatchImportEvaluatedAnnotationsResponse) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/models/*/evaluations/*/slices/*}:batchImport" - body: "*" - }; - option (google.api.method_signature) = "parent,evaluated_annotations"; - } - - // 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]; - - // Optional. The user-provided custom service account to use to do the model - // upload. If empty, [Vertex AI Service - // Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) - // will be used. Users uploading the Model must have the - // `iam.serviceAccounts.actAs` permission on this service account. Also, this - // account must belong to the project specified in the `parent` field and have - // all necessary read permissions. - string service_account = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// 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 - // [next_page_token][google.cloud.aiplatform.v1.ListModelVersionsResponse.next_page_token] - // of the previous - // [ListModelVersions][google.cloud.aiplatform.v1.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; - - // 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` - // - // Example: `update_time asc, create_time desc`. - string order_by = 6; -} - -// 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.CopyModel][google.cloud.aiplatform.v1.ModelService.CopyModel]. -message CopyModelRequest { - // If both fields are unset, a new Model will be created with a generated ID. - oneof destination_model { - // Optional. Copy source_model into a new Model with this ID. The ID 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 = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specify this field to copy source_model into this existing - // Model as a new version. Format: - // `projects/{project}/locations/{location}/models/{model}` - string parent_model = 5 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - } - - // Required. The resource name of the Location into which to copy the Model. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The resource name of the Model to copy. That Model must be in the - // same Project. Format: - // `projects/{project}/locations/{location}/models/{model}` - string source_model = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - - // Customer-managed encryption key options. If this is set, - // then the Model copy will be encrypted with the provided encryption key. - EncryptionSpec encryption_spec = 3; -} - -// Details of -// [ModelService.CopyModel][google.cloud.aiplatform.v1.ModelService.CopyModel] -// operation. -message CopyModelOperationMetadata { - // The common part of the operation metadata. - GenericOperationMetadata generic_metadata = 1; -} - -// Response message of -// [ModelService.CopyModel][google.cloud.aiplatform.v1.ModelService.CopyModel] -// operation. -message CopyModelResponse { - // The name of the copied 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 copied. - string model_version_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// 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.BatchImportEvaluatedAnnotations][google.cloud.aiplatform.v1.ModelService.BatchImportEvaluatedAnnotations] -message BatchImportEvaluatedAnnotationsRequest { - // Required. The name of the parent ModelEvaluationSlice resource. - // Format: - // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelEvaluationSlice" - } - ]; - - // Required. Evaluated annotations resource to be imported. - repeated EvaluatedAnnotation evaluated_annotations = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for -// [ModelService.BatchImportEvaluatedAnnotations][google.cloud.aiplatform.v1.ModelService.BatchImportEvaluatedAnnotations] -message BatchImportEvaluatedAnnotationsResponse { - // Output only. Number of EvaluatedAnnotations imported. - int32 imported_evaluated_annotations_count = 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/nas_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/nas_job.proto deleted file mode 100644 index ebffa6a70bf..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/nas_job.proto +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -option java_multiple_files = true; -option java_outer_classname = "NasJobProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Represents a Neural Architecture Search (NAS) job. -message NasJob { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/NasJob" - pattern: "projects/{project}/locations/{location}/nasJobs/{nas_job}" - }; - - // Output only. Resource name of the NasJob. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The display name of the NasJob. - // 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]; - - // Required. The specification of a NasJob. - NasJobSpec nas_job_spec = 4 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Output of the NasJob. - NasJobOutput nas_job_output = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The detailed state of the job. - JobState state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the NasJob was created. - google.protobuf.Timestamp create_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the NasJob for the first time entered the - // `JOB_STATE_RUNNING` state. - google.protobuf.Timestamp start_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the NasJob entered any of the following states: - // `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. - google.protobuf.Timestamp end_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the NasJob was most recently updated. - google.protobuf.Timestamp update_time = 10 - [(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 = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize NasJobs. - // - // 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 = 12; - - // Customer-managed encryption key options for a NasJob. - // If this is set, then all resources created by the NasJob - // will be encrypted with the provided encryption key. - EncryptionSpec encryption_spec = 13; - - // Optional. Enable a separation of Custom model training - // and restricted image training for tenant project. - bool enable_restricted_image_training = 14 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; -} - -// Represents a NasTrial details along with it's parameters. If there is a -// corresponding train NasTrial, the train NasTrial is also returned. -message NasTrialDetail { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/NasTrialDetail" - pattern: "projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}" - }; - - // Output only. Resource name of the NasTrialDetail. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The parameters for the NasJob NasTrial. - string parameters = 2; - - // The requested search NasTrial. - NasTrial search_trial = 3; - - // The train NasTrial corresponding to - // [search_trial][google.cloud.aiplatform.v1.NasTrialDetail.search_trial]. - // Only populated if - // [search_trial][google.cloud.aiplatform.v1.NasTrialDetail.search_trial] is - // used for training. - NasTrial train_trial = 4; -} - -// Represents the spec of a NasJob. -message NasJobSpec { - // The spec of multi-trial Neural Architecture Search (NAS). - message MultiTrialAlgorithmSpec { - // 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. - string metric_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The optimization goal of the metric. - GoalType goal = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Represent spec for search trials. - message SearchTrialSpec { - // Required. The spec of a search trial job. The same spec applies to - // all search trials. - CustomJobSpec search_trial_job_spec = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The maximum number of Neural Architecture Search (NAS) trials - // to run. - int32 max_trial_count = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The maximum number of trials to run in parallel. - int32 max_parallel_trial_count = 3 - [(google.api.field_behavior) = REQUIRED]; - - // The number of failed trials that need to be seen before failing - // the NasJob. - // - // If set to 0, Vertex AI decides how many trials must fail - // before the whole job fails. - int32 max_failed_trial_count = 4; - } - - // Represent spec for train trials. - message TrainTrialSpec { - // Required. The spec of a train trial job. The same spec applies to - // all train trials. - CustomJobSpec train_trial_job_spec = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The maximum number of trials to run in parallel. - int32 max_parallel_trial_count = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Required. Frequency of search trials to start train stage. Top N - // [TrainTrialSpec.max_parallel_trial_count] - // search trials will be trained for every M - // [TrainTrialSpec.frequency] trials searched. - int32 frequency = 3 [(google.api.field_behavior) = REQUIRED]; - } - - // The available types of multi-trial algorithms. - enum MultiTrialAlgorithm { - // Defaults to `REINFORCEMENT_LEARNING`. - MULTI_TRIAL_ALGORITHM_UNSPECIFIED = 0; - - // The Reinforcement Learning Algorithm for Multi-trial Neural - // Architecture Search (NAS). - REINFORCEMENT_LEARNING = 1; - - // The Grid Search Algorithm for Multi-trial Neural - // Architecture Search (NAS). - GRID_SEARCH = 2; - } - - // The multi-trial Neural Architecture Search (NAS) algorithm - // type. Defaults to `REINFORCEMENT_LEARNING`. - MultiTrialAlgorithm multi_trial_algorithm = 1; - - // Metric specs for the NAS job. - // Validation for this field is done at `multi_trial_algorithm_spec` field. - MetricSpec metric = 2; - - // Required. Spec for search trials. - SearchTrialSpec search_trial_spec = 3 - [(google.api.field_behavior) = REQUIRED]; - - // Spec for train trials. Top N [TrainTrialSpec.max_parallel_trial_count] - // search trials will be trained for every M - // [TrainTrialSpec.frequency] trials searched. - TrainTrialSpec train_trial_spec = 4; - } - - // The Neural Architecture Search (NAS) algorithm specification. - oneof nas_algorithm_spec { - // The spec of multi-trial algorithms. - MultiTrialAlgorithmSpec multi_trial_algorithm_spec = 2; - } - - // The ID of the existing NasJob in the same Project and Location - // which will be used to resume search. search_space_spec and - // nas_algorithm_spec are obtained from previous NasJob hence should not - // provide them again for this NasJob. - string resume_nas_job_id = 3; - - // It defines the search space for Neural Architecture Search (NAS). - string search_space_spec = 1; -} - -// Represents a uCAIP NasJob output. -message NasJobOutput { - // The output of a multi-trial Neural Architecture Search (NAS) jobs. - message MultiTrialJobOutput { - // Output only. List of NasTrials that were started as part of search stage. - repeated NasTrial search_trials = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. List of NasTrials that were started as part of train stage. - repeated NasTrial train_trials = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // The output of this Neural Architecture Search (NAS) job. - oneof output { - // Output only. The output of this multi-trial Neural Architecture Search - // (NAS) job. - MultiTrialJobOutput multi_trial_job_output = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } -} - -// Represents a uCAIP NasJob trial. -message NasTrial { - // Describes a NasTrial state. - enum State { - // The NasTrial state is unspecified. - STATE_UNSPECIFIED = 0; - - // Indicates that a specific NasTrial has been requested, but it has not yet - // been suggested by the service. - REQUESTED = 1; - - // Indicates that the NasTrial has been suggested. - ACTIVE = 2; - - // Indicates that the NasTrial should stop according to the service. - STOPPING = 3; - - // Indicates that the NasTrial is completed successfully. - SUCCEEDED = 4; - - // Indicates that the NasTrial should not be attempted again. - // The service will set a NasTrial to INFEASIBLE when it's done but missing - // the final_measurement. - INFEASIBLE = 5; - } - - // Output only. The identifier of the NasTrial assigned by the service. - string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The detailed state of the NasTrial. - State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The final measurement containing the objective value. - Measurement final_measurement = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the NasTrial was started. - google.protobuf.Timestamp start_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the NasTrial's status changed to `SUCCEEDED` or - // `INFEASIBLE`. - google.protobuf.Timestamp end_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/operation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/operation.proto deleted file mode 100644 index 8f8604124dd..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/operation.proto +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 Google Cloud 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto deleted file mode 100644 index fc33dacd304..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto deleted file mode 100644 index fbad9ec38c5..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto +++ /dev/null @@ -1,408 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 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 Google Cloud - // 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 - // [pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_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" - } - ]; - - // Output only. The names of the previously failed - // [CustomJob][google.cloud.aiplatform.v1.CustomJob] for the main container - // executions. The list includes the all attempts in chronological order. - repeated string failed_main_jobs = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The names of the previously failed - // [CustomJob][google.cloud.aiplatform.v1.CustomJob] for the - // pre-caching-check container executions. 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. The list - // includes the all attempts in chronological order. - repeated string failed_pre_caching_check_jobs = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // The detailed info for a custom job executor. - message CustomJobDetail { - // 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" - } - ]; - - // Output only. The names of the previously failed - // [CustomJob][google.cloud.aiplatform.v1.CustomJob]. The list includes the - // all attempts in chronological order. - repeated string failed_jobs = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - 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 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto deleted file mode 100644 index 39acd31657c..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto +++ /dev/null @@ -1,450 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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. - // * `labels` supports general map functions that is: - // `labels.key=value` - key:value equality - // `labels.key:* - key existence - // - // 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_state.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_state.proto deleted file mode 100644 index b4837370065..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/pipeline_state.proto +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/prediction_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/prediction_service.proto deleted file mode 100644 index 16463dd48c5..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/prediction_service.proto +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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: "*" - additional_bindings { - post: "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}: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: "*" - additional_bindings { - post: "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}: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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/saved_query.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/saved_query.proto deleted file mode 100644 index 55e5044b916..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/saved_query.proto +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto deleted file mode 100644 index e7f14c262ed..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto deleted file mode 100644 index cf6995dd65b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto deleted file mode 100644 index 0916ae560ee..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto deleted file mode 100644 index acf3ad88820..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto deleted file mode 100644 index 492d907d5ae..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto deleted file mode 100644 index cb3b732a487..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto deleted file mode 100644 index 0cc58f06d82..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto deleted file mode 100644 index d849d0476b6..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto deleted file mode 100644 index 4418c4926b0..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto deleted file mode 100644 index 68b6d402c6d..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/params/paramspb;paramspb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto deleted file mode 100644 index 6def9cb3d74..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/params/paramspb;paramspb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto deleted file mode 100644 index 83e12562c4a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/params/paramspb;paramspb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto deleted file mode 100644 index d7778531d2b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/params/paramspb;paramspb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto deleted file mode 100644 index acf7ce0d937..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/params/paramspb;paramspb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto deleted file mode 100644 index 721a080563c..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/params/paramspb;paramspb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto deleted file mode 100644 index a727b42bdde..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto deleted file mode 100644 index 8a449d2b63a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto deleted file mode 100644 index 5510a6c42e1..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto deleted file mode 100644 index cd49449dec0..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto deleted file mode 100644 index d3ebc73e043..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto deleted file mode 100644 index a16ce5c2166..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto deleted file mode 100644 index e5352b60d4d..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto deleted file mode 100644 index ea44f1e1d64..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto deleted file mode 100644 index d06450871ac..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto deleted file mode 100644 index 415c03d7780..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto deleted file mode 100644 index 697a9b61dbf..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto deleted file mode 100644 index a930bf140ca..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto deleted file mode 100644 index 69e7e893c76..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto deleted file mode 100644 index b0fcfbf4342..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto deleted file mode 100644 index ad75ea17436..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto deleted file mode 100644 index e12c4940910..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto deleted file mode 100644 index 642e9d50e7a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto deleted file mode 100644 index 870066f7672..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto deleted file mode 100644 index 67260122440..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto deleted file mode 100644 index c941b5c8c5f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto deleted file mode 100644 index f5eaa303a24..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1/schema/trainingjob/definition/definitionpb;definitionpb"; -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.search_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.delete_feature_values.jsinclude:samples/generated/v1beta1/featurestore_service.delete_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_nas_job.jsinclude:samples/generated/v1beta1/job_service.get_nas_job.jsinclude:samples/generated/v1beta1/job_service.cancel_nas_job.jsinclude:samples/generated/v1beta1/job_service.get_nas_trial_detail.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_nas_job.jsinclude:samples/generated/v1beta1/job_service.delete_nas_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_nas_jobs.jsinclude:samples/generated/v1beta1/job_service.list_nas_trial_details.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/match_service.find_neighbors.jsinclude:samples/generated/v1beta1/match_service.read_index_datapoints.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.remove_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.batch_import_evaluated_annotations.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.copy_model.jsinclude:samples/generated/v1beta1/model_service.copy_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/schedule_service.create_schedule.jsinclude:samples/generated/v1beta1/schedule_service.get_schedule.jsinclude:samples/generated/v1beta1/schedule_service.pause_schedule.jsinclude:samples/generated/v1beta1/schedule_service.resume_schedule.jsinclude:samples/generated/v1beta1/schedule_service.delete_schedule.jsinclude:samples/generated/v1beta1/schedule_service.delete_schedule.jsinclude:samples/generated/v1beta1/schedule_service.list_schedules.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.read_tensorboard_usage.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.get_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_runs.jsinclude:samples/generated/v1beta1/tensorboard_service.get_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.get_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.batch_read_tensorboard_time_series_data.jsinclude:samples/generated/v1beta1/tensorboard_service.read_tensorboard_time_series_data.jsinclude:samples/generated/v1beta1/tensorboard_service.write_tensorboard_experiment_data.jsinclude:samples/generated/v1beta1/tensorboard_service.write_tensorboard_run_data.jsinclude:samples/generated/v1beta1/tensorboard_service.read_tensorboard_blob_data.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.list_tensorboards.jsinclude:samples/generated/v1beta1/tensorboard_service.list_tensorboard_experiments.jsinclude:samples/generated/v1beta1/tensorboard_service.list_tensorboard_runs.jsinclude:samples/generated/v1beta1/tensorboard_service.list_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.jsinclude:samples/generated/v1beta1/vizier_service.create_study.jsinclude:samples/generated/v1beta1/vizier_service.get_study.jsinclude:samples/generated/v1beta1/vizier_service.delete_study.jsinclude:samples/generated/v1beta1/vizier_service.lookup_study.jsinclude:samples/generated/v1beta1/vizier_service.create_trial.jsinclude:samples/generated/v1beta1/vizier_service.get_trial.jsinclude:samples/generated/v1beta1/vizier_service.add_trial_measurement.jsinclude:samples/generated/v1beta1/vizier_service.complete_trial.jsinclude:samples/generated/v1beta1/vizier_service.delete_trial.jsinclude:samples/generated/v1beta1/vizier_service.stop_trial.jsinclude:samples/generated/v1beta1/vizier_service.list_optimal_trials.jsinclude:samples/generated/v1beta1/vizier_service.suggest_trials.jsinclude:samples/generated/v1beta1/vizier_service.suggest_trials.jsinclude:samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.jsinclude:samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.jsinclude:samples/generated/v1beta1/vizier_service.list_studies.jsinclude:samples/generated/v1beta1/vizier_service.list_trials.jsinclude:samples/generated/v1beta1/endpoint_service.mutate_deployed_model.jsinclude:samples/generated/v1beta1/endpoint_service.mutate_deployed_model.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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/service_networking.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/service_networking.proto deleted file mode 100644 index 55bd8c59666..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/service_networking.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -option java_multiple_files = true; -option java_outer_classname = "ServiceNetworkingProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Represents configuration for private service connect. -message PrivateServiceConnectConfig { - // Required. If true, expose the IndexEndpoint via private service connect. - bool enable_private_service_connect = 1 - [(google.api.field_behavior) = REQUIRED]; - - // A list of Projects from which the forwarding rule will target the service - // attachment. - repeated string project_allowlist = 2; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/specialist_pool.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/specialist_pool.proto deleted file mode 100644 index 158b0b20166..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/specialist_pool.proto +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/specialist_pool_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/specialist_pool_service.proto deleted file mode 100644 index cfd0b05c721..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/specialist_pool_service.proto +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/study.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/study.proto deleted file mode 100644 index 5f998a027f1..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/study.proto +++ /dev/null @@ -1,602 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 { - // Used in safe optimization to specify threshold levels and risk tolerance. - message SafetyMetricConfig { - // Safety threshold (boundary value between safe and unsafe). NOTE that if - // you leave SafetyMetricConfig unset, a default value of 0 will be used. - double safety_threshold = 1; - - // Desired minimum fraction of safe trials (over total number of trials) - // that should be targeted by the algorithm at any time during the - // study (best effort). This should be between 0.0 and 1.0 and a value of - // 0.0 means that there is no minimum and an algorithm proceeds without - // targeting any specific fraction. A value of 1.0 means that the - // algorithm attempts to only Suggest safe Trials. - optional double desired_min_safe_trials_fraction = 2; - } - - // 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]; - - // Used for safe search. In the case, the metric will be a safety - // metric. You must provide a separate metric for objective metric. - optional SafetyMetricConfig safety_config = 3; - } - - // 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; - - // ConvexAutomatedStoppingSpec by default only updates the trials that needs - // to be early stopped using a newly trained auto-regressive model. When - // this flag is set to True, all stopped trials from the beginning are - // potentially updated in terms of their `final_measurement`. Also, note - // that the training logic of autoregressive models is different in this - // case. Enabling this option has shown better results and this may be the - // default option in the future. - optional bool update_all_stopped_trials = 6; - } - - // 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard.proto deleted file mode 100644 index d22b961d795..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard.proto +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 Google Cloud 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; - - // Used to indicate if the TensorBoard instance is the default one. - // Each project & region can have at most one default TensorBoard instance. - // Creation of a default TensorBoard instance and updating an existing - // TensorBoard instance to be default will mark all other TensorBoard - // instances (if any) as non default. - bool is_default = 12; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_data.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_data.proto deleted file mode 100644 index 291e88a0d0c..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_data.proto +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto deleted file mode 100644 index 6ae26d3efad..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 cannot be 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. The 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 = 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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_run.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_run.proto deleted file mode 100644 index 1dc445e54bf..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_run.proto +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_service.proto deleted file mode 100644 index 979f5aae94f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_service.proto +++ /dev/null @@ -1,1133 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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"; - } - - // Returns a list of monthly active users for a given TensorBoard instance. - rpc ReadTensorboardUsage(ReadTensorboardUsageRequest) - returns (ReadTensorboardUsageResponse) { - option (google.api.http) = { - get: "/v1/{tensorboard=projects/*/locations/*/tensorboards/*}:readUsage" - }; - option (google.api.method_signature) = "tensorboard"; - } - - // 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 is returned. - // Otherwise, the number limit of data points is 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 is returned. Otherwise, 1000 - // data points is 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 is 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 is 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.GetTensorboardUsage][]. -message ReadTensorboardUsageRequest { - // Required. The name of the Tensorboard resource. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - string tensorboard = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Tensorboard" - } - ]; -} - -// Response message for -// [TensorboardService.ReadTensorboardUsage][google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardUsage]. -message ReadTensorboardUsageResponse { - // Per user usage data. - message PerUserUsageData { - // User's username - string username = 1; - - // Number of times the user has read data within the Tensorboard. - int64 view_count = 2; - } - - // Per month usage data - message PerMonthUsageData { - // Usage data for each user in the given month. - repeated PerUserUsageData user_usage_data = 1; - } - - // Maps year-month (YYYYMM) string to per month usage data. - map monthly_usage_data = 1; -} - -// 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 are - // returned. The maximum value is 100; values above 100 are 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 is overwritten if it's in the mask. If the - // user does not provide a mask then all fields are 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 becomes 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 are returned. The maximum value is 1000; values - // above 1000 are 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 is overwritten if it's in the mask. If the - // user does not provide a mask then all fields are 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 becomes 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 are - // returned. The maximum value is 1000; values above 1000 are 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 is overwritten if it's in the mask. If the - // user does not provide a mask then all fields are 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 becomes 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 are returned. The maximum value is 1000; values - // above 1000 are 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 is overwritten if it's in the mask. If the - // user does not provide a mask then all fields are 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 is 1000. Values must be between 1 and 10000. - // Values above 10000 are coerced to 10000. - int32 page_size = 3; - - // A page token, received from a previous - // [ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData] - // call. Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData] - // 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 is 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 - // [page_token][google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest.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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto deleted file mode 100644 index ef669d839d0..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto deleted file mode 100644 index 11c8f28fc06..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto +++ /dev/null @@ -1,449 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; -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 {@link google.cloud.aiplatform.v1.Dataset | 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 {@link google.cloud.aiplatform.v1.AnnotationSpec | 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 {@link google.cloud.aiplatform.v1.Dataset | 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 {@link google.cloud.aiplatform.v1.Dataset | 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 - * {@link google.cloud.aiplatform.v1.Dataset | 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 {@link google.cloud.aiplatform.v1.DataItem | 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 {@link google.cloud.aiplatform.v1.DataItem | 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 - * {@link google.cloud.aiplatform.v1.DataItem | 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; - } - /** - * Searches DataItems in a Dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.orderByDataItem - * A comma-separated list of data item fields to order by, sorted in - * ascending order. Use "desc" after a field name for descending. - * @param {google.cloud.aiplatform.v1.SearchDataItemsRequest.OrderByAnnotation} request.orderByAnnotation - * Expression that allows ranking results based on annotation's property. - * @param {string} request.dataset - * Required. The resource name of the Dataset from which to search DataItems. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {string} request.savedQuery - * The resource name of a SavedQuery(annotation set in UI). - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` - * All of the search will be done in the context of this SavedQuery. - * @param {string} request.dataLabelingJob - * The resource name of a DataLabelingJob. - * Format: - * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - * If this field is set, all of the search will be done in the context of - * this DataLabelingJob. - * @param {string} request.dataItemFilter - * An expression for filtering the DataItem that will be returned. - * - * * `data_item_id` - for = or !=. - * * `labeled` - for = or !=. - * * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that - * have at least one annotation with annotation_spec_id = - * `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. - * - * For example: - * - * * `data_item=1` - * * `has_annotation(5)` - * @param {string} request.annotationsFilter - * An expression for filtering the Annotations that will be returned per - * DataItem. - * * `annotation_spec_id` - for = or !=. - * @param {string[]} request.annotationFilters - * An expression that specifies what Annotations will be returned per - * DataItem. Annotations satisfied either of the conditions will be returned. - * * `annotation_spec_id` - for = or !=. - * Must specify `saved_query_id=` - saved query id that annotations should - * belong to. - * @param {google.protobuf.FieldMask} request.fieldMask - * Mask specifying which fields of - * {@link google.cloud.aiplatform.v1.DataItemView|DataItemView} to read. - * @param {number} request.annotationsLimit - * If set, only up to this many of Annotations will be returned per - * DataItemView. The maximum value is 1000. If not set, the maximum value will - * be used. - * @param {number} request.pageSize - * Requested page size. Server may return fewer results than requested. - * Default and maximum page size is 100. - * @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 {string} request.pageToken - * A token identifying a page of results for the server to return - * Typically obtained via - * {@link google.cloud.aiplatform.v1.SearchDataItemsResponse.next_page_token|SearchDataItemsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1.DatasetService.SearchDataItems|DatasetService.SearchDataItems} - * call. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.cloud.aiplatform.v1.DataItemView | DataItemView}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `searchDataItemsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchDataItems( - request?: protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IDataItemView[], - protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest|null, - protos.google.cloud.aiplatform.v1.ISearchDataItemsResponse - ]>; - searchDataItems( - request: protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, - protos.google.cloud.aiplatform.v1.ISearchDataItemsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IDataItemView>): void; - searchDataItems( - request: protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, - protos.google.cloud.aiplatform.v1.ISearchDataItemsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IDataItemView>): void; - searchDataItems( - request?: protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, - protos.google.cloud.aiplatform.v1.ISearchDataItemsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IDataItemView>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, - protos.google.cloud.aiplatform.v1.ISearchDataItemsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IDataItemView>): - Promise<[ - protos.google.cloud.aiplatform.v1.IDataItemView[], - protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest|null, - protos.google.cloud.aiplatform.v1.ISearchDataItemsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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': request.dataset ?? '', - }); - this.initialize(); - return this.innerApiCalls.searchDataItems(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.orderByDataItem - * A comma-separated list of data item fields to order by, sorted in - * ascending order. Use "desc" after a field name for descending. - * @param {google.cloud.aiplatform.v1.SearchDataItemsRequest.OrderByAnnotation} request.orderByAnnotation - * Expression that allows ranking results based on annotation's property. - * @param {string} request.dataset - * Required. The resource name of the Dataset from which to search DataItems. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {string} request.savedQuery - * The resource name of a SavedQuery(annotation set in UI). - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` - * All of the search will be done in the context of this SavedQuery. - * @param {string} request.dataLabelingJob - * The resource name of a DataLabelingJob. - * Format: - * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - * If this field is set, all of the search will be done in the context of - * this DataLabelingJob. - * @param {string} request.dataItemFilter - * An expression for filtering the DataItem that will be returned. - * - * * `data_item_id` - for = or !=. - * * `labeled` - for = or !=. - * * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that - * have at least one annotation with annotation_spec_id = - * `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. - * - * For example: - * - * * `data_item=1` - * * `has_annotation(5)` - * @param {string} request.annotationsFilter - * An expression for filtering the Annotations that will be returned per - * DataItem. - * * `annotation_spec_id` - for = or !=. - * @param {string[]} request.annotationFilters - * An expression that specifies what Annotations will be returned per - * DataItem. Annotations satisfied either of the conditions will be returned. - * * `annotation_spec_id` - for = or !=. - * Must specify `saved_query_id=` - saved query id that annotations should - * belong to. - * @param {google.protobuf.FieldMask} request.fieldMask - * Mask specifying which fields of - * {@link google.cloud.aiplatform.v1.DataItemView|DataItemView} to read. - * @param {number} request.annotationsLimit - * If set, only up to this many of Annotations will be returned per - * DataItemView. The maximum value is 1000. If not set, the maximum value will - * be used. - * @param {number} request.pageSize - * Requested page size. Server may return fewer results than requested. - * Default and maximum page size is 100. - * @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 {string} request.pageToken - * A token identifying a page of results for the server to return - * Typically obtained via - * {@link google.cloud.aiplatform.v1.SearchDataItemsResponse.next_page_token|SearchDataItemsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1.DatasetService.SearchDataItems|DatasetService.SearchDataItems} - * call. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.cloud.aiplatform.v1.DataItemView | DataItemView} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `searchDataItemsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchDataItemsStream( - request?: protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, - 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({ - 'dataset': request.dataset ?? '', - }); - const defaultCallSettings = this._defaults['searchDataItems']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchDataItems.createStream( - this.innerApiCalls.searchDataItems as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `searchDataItems`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.orderByDataItem - * A comma-separated list of data item fields to order by, sorted in - * ascending order. Use "desc" after a field name for descending. - * @param {google.cloud.aiplatform.v1.SearchDataItemsRequest.OrderByAnnotation} request.orderByAnnotation - * Expression that allows ranking results based on annotation's property. - * @param {string} request.dataset - * Required. The resource name of the Dataset from which to search DataItems. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {string} request.savedQuery - * The resource name of a SavedQuery(annotation set in UI). - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` - * All of the search will be done in the context of this SavedQuery. - * @param {string} request.dataLabelingJob - * The resource name of a DataLabelingJob. - * Format: - * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - * If this field is set, all of the search will be done in the context of - * this DataLabelingJob. - * @param {string} request.dataItemFilter - * An expression for filtering the DataItem that will be returned. - * - * * `data_item_id` - for = or !=. - * * `labeled` - for = or !=. - * * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that - * have at least one annotation with annotation_spec_id = - * `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. - * - * For example: - * - * * `data_item=1` - * * `has_annotation(5)` - * @param {string} request.annotationsFilter - * An expression for filtering the Annotations that will be returned per - * DataItem. - * * `annotation_spec_id` - for = or !=. - * @param {string[]} request.annotationFilters - * An expression that specifies what Annotations will be returned per - * DataItem. Annotations satisfied either of the conditions will be returned. - * * `annotation_spec_id` - for = or !=. - * Must specify `saved_query_id=` - saved query id that annotations should - * belong to. - * @param {google.protobuf.FieldMask} request.fieldMask - * Mask specifying which fields of - * {@link google.cloud.aiplatform.v1.DataItemView|DataItemView} to read. - * @param {number} request.annotationsLimit - * If set, only up to this many of Annotations will be returned per - * DataItemView. The maximum value is 1000. If not set, the maximum value will - * be used. - * @param {number} request.pageSize - * Requested page size. Server may return fewer results than requested. - * Default and maximum page size is 100. - * @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 {string} request.pageToken - * A token identifying a page of results for the server to return - * Typically obtained via - * {@link google.cloud.aiplatform.v1.SearchDataItemsResponse.next_page_token|SearchDataItemsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1.DatasetService.SearchDataItems|DatasetService.SearchDataItems} - * call. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.aiplatform.v1.DataItemView | DataItemView}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see 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_SearchDataItems_async - */ - searchDataItemsAsync( - request?: protos.google.cloud.aiplatform.v1.ISearchDataItemsRequest, - 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({ - 'dataset': request.dataset ?? '', - }); - const defaultCallSettings = this._defaults['searchDataItems']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchDataItems.asyncIterate( - this.innerApiCalls['searchDataItems'] 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 {@link google.cloud.aiplatform.v1.SavedQuery | 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 {@link google.cloud.aiplatform.v1.SavedQuery | 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 - * {@link google.cloud.aiplatform.v1.SavedQuery | 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 {@link google.cloud.aiplatform.v1.Annotation | 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 {@link google.cloud.aiplatform.v1.Annotation | 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 - * {@link google.cloud.aiplatform.v1.Annotation | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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/google-cloud-aiplatform/v1/src/v1/dataset_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/dataset_service_client_config.json deleted file mode 100644 index ac943c50a3e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/dataset_service_client_config.json +++ /dev/null @@ -1,74 +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" - }, - "SearchDataItems": { - "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/google-cloud-aiplatform/v1/src/v1/dataset_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/dataset_service_proto_list.json deleted file mode 100644 index b7295bb569f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/dataset_service_proto_list.json +++ /dev/null @@ -1,115 +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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/endpoint_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_client.ts deleted file mode 100644 index 7bcbe61280f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_client.ts +++ /dev/null @@ -1,3975 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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; - const mutateDeployedModelResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.MutateDeployedModelResponse') as gax.protobuf.Type; - const mutateDeployedModelMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata') 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)), - mutateDeployedModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - mutateDeployedModelResponse.decode.bind(mutateDeployedModelResponse), - mutateDeployedModelMetadata.decode.bind(mutateDeployedModelMetadata)) - }; - - // 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', 'mutateDeployedModel']; - 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 {@link google.cloud.aiplatform.v1.Endpoint | 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 {@link google.cloud.aiplatform.v1.Endpoint | 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. - * - * If the first character is a letter, this value may be up to 63 characters, - * and valid characters are `[a-z0-9-]`. The last character must be a letter - * or number. - * - * If the first character is a number, this value may be up to 9 characters, - * and valid characters are `[0-9]` with no leading zeros. - * - * 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; - } -/** - * Updates an existing deployed model. Updatable fields include - * `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, - * `disable_container_logging` (v1 only), and `enable_container_logging` - * (v1beta1 only). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.endpoint - * Required. The name of the Endpoint resource into which to mutate a - * DeployedModel. Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param {google.cloud.aiplatform.v1.DeployedModel} request.deployedModel - * Required. The DeployedModel to be mutated within the Endpoint. Only the - * following fields can be mutated: - * - * * `min_replica_count` in either - * {@link google.cloud.aiplatform.v1.DedicatedResources|DedicatedResources} or - * {@link google.cloud.aiplatform.v1.AutomaticResources|AutomaticResources} - * * `max_replica_count` in either - * {@link google.cloud.aiplatform.v1.DedicatedResources|DedicatedResources} or - * {@link google.cloud.aiplatform.v1.AutomaticResources|AutomaticResources} - * * {@link google.cloud.aiplatform.v1.DedicatedResources.autoscaling_metric_specs|autoscaling_metric_specs} - * * `disable_container_logging` (v1 only) - * * `enable_container_logging` (v1beta1 only) - * @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 - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://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_MutateDeployedModel_async - */ - mutateDeployedModel( - request?: protos.google.cloud.aiplatform.v1.IMutateDeployedModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - mutateDeployedModel( - request: protos.google.cloud.aiplatform.v1.IMutateDeployedModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - mutateDeployedModel( - request: protos.google.cloud.aiplatform.v1.IMutateDeployedModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - mutateDeployedModel( - request?: protos.google.cloud.aiplatform.v1.IMutateDeployedModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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.mutateDeployedModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `mutateDeployedModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://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_MutateDeployedModel_async - */ - async checkMutateDeployedModelProgress(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.mutateDeployedModel, 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 [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"` - * @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 {@link google.cloud.aiplatform.v1.Endpoint | 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 [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"` - * @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 {@link google.cloud.aiplatform.v1.Endpoint | 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 [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"` - * @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 - * {@link google.cloud.aiplatform.v1.Endpoint | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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/google-cloud-aiplatform/v1/src/v1/endpoint_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_client_config.json deleted file mode 100644 index 24f529b92ba..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_client_config.json +++ /dev/null @@ -1,58 +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" - }, - "MutateDeployedModel": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_proto_list.json deleted file mode 100644 index b7295bb569f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/endpoint_service_proto_list.json +++ /dev/null @@ -1,115 +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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_client.ts deleted file mode 100644 index 9817a8cc7e4..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_client.ts +++ /dev/null @@ -1,2957 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, 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}; - 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - 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') - }; - - // 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', '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.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 {@link google.cloud.aiplatform.v1.ReadFeatureValuesResponse | 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); - } -/** - * 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 {@link google.cloud.aiplatform.v1.WriteFeatureValuesResponse | 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_v1_generated_FeaturestoreOnlineServingService_WriteFeatureValues_async - */ - writeFeatureValues( - request?: protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IWriteFeatureValuesResponse, - protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest|undefined, {}|undefined - ]>; - writeFeatureValues( - request: protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IWriteFeatureValuesResponse, - protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest|null|undefined, - {}|null|undefined>): void; - writeFeatureValues( - request: protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IWriteFeatureValuesResponse, - protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest|null|undefined, - {}|null|undefined>): void; - writeFeatureValues( - request?: protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IWriteFeatureValuesResponse, - protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IWriteFeatureValuesResponse, - protos.google.cloud.aiplatform.v1.IWriteFeatureValuesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IWriteFeatureValuesResponse, - protos.google.cloud.aiplatform.v1.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.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 {@link google.cloud.aiplatform.v1.ReadFeatureValuesResponse | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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); - } - - // -------------------- - // -- 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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_client_config.json deleted file mode 100644 index ca3c186f53d..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_client_config.json +++ /dev/null @@ -1,38 +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" - }, - "WriteFeatureValues": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_proto_list.json deleted file mode 100644 index b7295bb569f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_online_serving_service_proto_list.json +++ /dev/null @@ -1,115 +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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/featurestore_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_client.ts deleted file mode 100644 index 9f1a947c2cf..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_client.ts +++ /dev/null @@ -1,6109 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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; - const deleteFeatureValuesResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteFeatureValuesResponse') as gax.protobuf.Type; - const deleteFeatureValuesMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteFeatureValuesOperationMetadata') 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)), - deleteFeatureValues: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteFeatureValuesResponse.decode.bind(deleteFeatureValuesResponse), - deleteFeatureValuesMetadata.decode.bind(deleteFeatureValuesMetadata)) - }; - - // 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', 'deleteFeatureValues', '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 {@link google.cloud.aiplatform.v1.Featurestore | 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 {@link google.cloud.aiplatform.v1.EntityType | 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` - * * `offline_storage_ttl_days` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.aiplatform.v1.EntityType | 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 {@link google.cloud.aiplatform.v1.Feature | 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 {@link google.cloud.aiplatform.v1.Feature | 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` - * * `online_storage_ttl_days` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://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 128 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. - * @param {google.protobuf.Timestamp} [request.startTime] - * Optional. 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://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; - } -/** - * Delete Feature values from Featurestore. - * - * The progress of the deletion is tracked by the returned operation. The - * deleted feature values are guaranteed to be invisible to subsequent read - * operations after the operation is marked as successfully done. - * - * If a delete feature values operation fails, the feature values - * returned from reads and exports may be inconsistent. If consistency is - * required, the caller must retry the same delete request again and wait till - * the new operation returned is marked as successfully done. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.DeleteFeatureValuesRequest.SelectEntity} request.selectEntity - * Select feature values to be deleted by specifying entities. - * @param {google.cloud.aiplatform.v1.DeleteFeatureValuesRequest.SelectTimeRangeAndFeature} request.selectTimeRangeAndFeature - * Select feature values to be deleted by specifying time range and - * features. - * @param {string} request.entityType - * Required. The resource name of the EntityType grouping the Features for - * which values are being deleted from. Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{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_DeleteFeatureValues_async - */ - deleteFeatureValues( - request?: protos.google.cloud.aiplatform.v1.IDeleteFeatureValuesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteFeatureValues( - request: protos.google.cloud.aiplatform.v1.IDeleteFeatureValuesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteFeatureValues( - request: protos.google.cloud.aiplatform.v1.IDeleteFeatureValuesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteFeatureValues( - request?: protos.google.cloud.aiplatform.v1.IDeleteFeatureValuesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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.deleteFeatureValues(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteFeatureValues()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://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_DeleteFeatureValues_async - */ - async checkDeleteFeatureValuesProgress(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.deleteFeatureValues, 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 {@link google.cloud.aiplatform.v1.Featurestore | 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 {@link google.cloud.aiplatform.v1.Featurestore | 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 - * {@link google.cloud.aiplatform.v1.Featurestore | 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 {@link google.cloud.aiplatform.v1.EntityType | 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 {@link google.cloud.aiplatform.v1.EntityType | 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 - * {@link google.cloud.aiplatform.v1.EntityType | 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 {@link google.cloud.aiplatform.v1.Feature | 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 {@link google.cloud.aiplatform.v1.Feature | 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 - * {@link google.cloud.aiplatform.v1.Feature | 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 {@link google.cloud.aiplatform.v1.Feature | 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 {@link google.cloud.aiplatform.v1.Feature | 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 - * {@link google.cloud.aiplatform.v1.Feature | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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/google-cloud-aiplatform/v1/src/v1/featurestore_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_client_config.json deleted file mode 100644 index f1d667857a9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_client_config.json +++ /dev/null @@ -1,110 +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" - }, - "DeleteFeatureValues": { - "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/google-cloud-aiplatform/v1/src/v1/featurestore_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_proto_list.json deleted file mode 100644 index b7295bb569f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/featurestore_service_proto_list.json +++ /dev/null @@ -1,115 +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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/gapic_metadata.json deleted file mode 100644 index ead7be93841..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,2439 +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" - ] - }, - "SearchDataItems": { - "methods": [ - "searchDataItems", - "searchDataItemsStream", - "searchDataItemsAsync" - ] - }, - "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" - ] - }, - "SearchDataItems": { - "methods": [ - "searchDataItems", - "searchDataItemsStream", - "searchDataItemsAsync" - ] - }, - "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" - ] - }, - "MutateDeployedModel": { - "methods": [ - "mutateDeployedModel" - ] - }, - "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" - ] - }, - "MutateDeployedModel": { - "methods": [ - "mutateDeployedModel" - ] - }, - "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" - ] - }, - "DeleteFeatureValues": { - "methods": [ - "deleteFeatureValues" - ] - }, - "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" - ] - }, - "DeleteFeatureValues": { - "methods": [ - "deleteFeatureValues" - ] - }, - "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" - ] - }, - "CreateNasJob": { - "methods": [ - "createNasJob" - ] - }, - "GetNasJob": { - "methods": [ - "getNasJob" - ] - }, - "CancelNasJob": { - "methods": [ - "cancelNasJob" - ] - }, - "GetNasTrialDetail": { - "methods": [ - "getNasTrialDetail" - ] - }, - "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" - ] - }, - "DeleteNasJob": { - "methods": [ - "deleteNasJob" - ] - }, - "DeleteBatchPredictionJob": { - "methods": [ - "deleteBatchPredictionJob" - ] - }, - "UpdateModelDeploymentMonitoringJob": { - "methods": [ - "updateModelDeploymentMonitoringJob" - ] - }, - "DeleteModelDeploymentMonitoringJob": { - "methods": [ - "deleteModelDeploymentMonitoringJob" - ] - }, - "ListCustomJobs": { - "methods": [ - "listCustomJobs", - "listCustomJobsStream", - "listCustomJobsAsync" - ] - }, - "ListDataLabelingJobs": { - "methods": [ - "listDataLabelingJobs", - "listDataLabelingJobsStream", - "listDataLabelingJobsAsync" - ] - }, - "ListHyperparameterTuningJobs": { - "methods": [ - "listHyperparameterTuningJobs", - "listHyperparameterTuningJobsStream", - "listHyperparameterTuningJobsAsync" - ] - }, - "ListNasJobs": { - "methods": [ - "listNasJobs", - "listNasJobsStream", - "listNasJobsAsync" - ] - }, - "ListNasTrialDetails": { - "methods": [ - "listNasTrialDetails", - "listNasTrialDetailsStream", - "listNasTrialDetailsAsync" - ] - }, - "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" - ] - }, - "CreateNasJob": { - "methods": [ - "createNasJob" - ] - }, - "GetNasJob": { - "methods": [ - "getNasJob" - ] - }, - "CancelNasJob": { - "methods": [ - "cancelNasJob" - ] - }, - "GetNasTrialDetail": { - "methods": [ - "getNasTrialDetail" - ] - }, - "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" - ] - }, - "DeleteNasJob": { - "methods": [ - "deleteNasJob" - ] - }, - "DeleteBatchPredictionJob": { - "methods": [ - "deleteBatchPredictionJob" - ] - }, - "UpdateModelDeploymentMonitoringJob": { - "methods": [ - "updateModelDeploymentMonitoringJob" - ] - }, - "DeleteModelDeploymentMonitoringJob": { - "methods": [ - "deleteModelDeploymentMonitoringJob" - ] - }, - "ListCustomJobs": { - "methods": [ - "listCustomJobs", - "listCustomJobsStream", - "listCustomJobsAsync" - ] - }, - "ListDataLabelingJobs": { - "methods": [ - "listDataLabelingJobs", - "listDataLabelingJobsStream", - "listDataLabelingJobsAsync" - ] - }, - "ListHyperparameterTuningJobs": { - "methods": [ - "listHyperparameterTuningJobs", - "listHyperparameterTuningJobsStream", - "listHyperparameterTuningJobsAsync" - ] - }, - "ListNasJobs": { - "methods": [ - "listNasJobs", - "listNasJobsStream", - "listNasJobsAsync" - ] - }, - "ListNasTrialDetails": { - "methods": [ - "listNasTrialDetails", - "listNasTrialDetailsStream", - "listNasTrialDetailsAsync" - ] - }, - "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" - ] - }, - "RemoveContextChildren": { - "methods": [ - "removeContextChildren" - ] - }, - "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" - ] - }, - "RemoveContextChildren": { - "methods": [ - "removeContextChildren" - ] - }, - "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" - ] - }, - "BatchImportEvaluatedAnnotations": { - "methods": [ - "batchImportEvaluatedAnnotations" - ] - }, - "GetModelEvaluation": { - "methods": [ - "getModelEvaluation" - ] - }, - "GetModelEvaluationSlice": { - "methods": [ - "getModelEvaluationSlice" - ] - }, - "UploadModel": { - "methods": [ - "uploadModel" - ] - }, - "DeleteModel": { - "methods": [ - "deleteModel" - ] - }, - "DeleteModelVersion": { - "methods": [ - "deleteModelVersion" - ] - }, - "ExportModel": { - "methods": [ - "exportModel" - ] - }, - "CopyModel": { - "methods": [ - "copyModel" - ] - }, - "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" - ] - }, - "BatchImportEvaluatedAnnotations": { - "methods": [ - "batchImportEvaluatedAnnotations" - ] - }, - "GetModelEvaluation": { - "methods": [ - "getModelEvaluation" - ] - }, - "GetModelEvaluationSlice": { - "methods": [ - "getModelEvaluationSlice" - ] - }, - "UploadModel": { - "methods": [ - "uploadModel" - ] - }, - "DeleteModel": { - "methods": [ - "deleteModel" - ] - }, - "DeleteModelVersion": { - "methods": [ - "deleteModelVersion" - ] - }, - "ExportModel": { - "methods": [ - "exportModel" - ] - }, - "CopyModel": { - "methods": [ - "copyModel" - ] - }, - "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" - ] - }, - "ReadTensorboardUsage": { - "methods": [ - "readTensorboardUsage" - ] - }, - "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" - ] - }, - "ReadTensorboardUsage": { - "methods": [ - "readTensorboardUsage" - ] - }, - "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/google-cloud-aiplatform/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index.ts deleted file mode 100644 index 46e5062e243..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_client.ts deleted file mode 100644 index c46a62ad6d5..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_client.ts +++ /dev/null @@ -1,3901 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1.IndexEndpoint | 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 {@link google.cloud.aiplatform.v1.IndexEndpoint | 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 {@link google.cloud.aiplatform.v1.IndexEndpoint | 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 {@link google.cloud.aiplatform.v1.IndexEndpoint | 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 - * {@link google.cloud.aiplatform.v1.IndexEndpoint | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_client_config.json deleted file mode 100644 index 2a6743ffe88..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_proto_list.json deleted file mode 100644 index b7295bb569f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_endpoint_service_proto_list.json +++ /dev/null @@ -1,115 +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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/index_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_service_client.ts deleted file mode 100644 index 59c76d0b681..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_service_client.ts +++ /dev/null @@ -1,3717 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1.Index | 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 {@link google.cloud.aiplatform.v1.UpsertDatapointsResponse | 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 {@link google.cloud.aiplatform.v1.RemoveDatapointsResponse | 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 {@link google.cloud.aiplatform.v1.Index | 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 {@link google.cloud.aiplatform.v1.Index | 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 - * {@link google.cloud.aiplatform.v1.Index | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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/google-cloud-aiplatform/v1/src/v1/index_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_service_client_config.json deleted file mode 100644 index fb5e197f295..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/src/v1/index_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_service_proto_list.json deleted file mode 100644 index b7295bb569f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/index_service_proto_list.json +++ /dev/null @@ -1,115 +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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/job_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_client.ts deleted file mode 100644 index 9aca88cce6f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_client.ts +++ /dev/null @@ -1,7238 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - 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'), - listNasJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'nasJobs'), - listNasTrialDetails: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'nasTrialDetails'), - 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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 deleteNasJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteNasJobMetadata = 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)), - deleteNasJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteNasJobResponse.decode.bind(deleteNasJobResponse), - deleteNasJobMetadata.decode.bind(deleteNasJobMetadata)), - 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', 'createNasJob', 'getNasJob', 'listNasJobs', 'deleteNasJob', 'cancelNasJob', 'getNasTrialDetail', 'listNasTrialDetails', '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', - '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 -- - // ------------------- -/** - * 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 {@link google.cloud.aiplatform.v1.CustomJob | 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 {@link google.cloud.aiplatform.v1.CustomJob | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1.DataLabelingJob | 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 {@link google.cloud.aiplatform.v1.DataLabelingJob | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1.HyperparameterTuningJob | 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 {@link google.cloud.aiplatform.v1.HyperparameterTuningJob | 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 {@link google.protobuf.Empty | 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 NasJob - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the NasJob in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1.NasJob} request.nasJob - * Required. The NasJob 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 {@link google.cloud.aiplatform.v1.NasJob | NasJob}. - * Please see the - * [documentation](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_CreateNasJob_async - */ - createNasJob( - request?: protos.google.cloud.aiplatform.v1.ICreateNasJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.INasJob, - protos.google.cloud.aiplatform.v1.ICreateNasJobRequest|undefined, {}|undefined - ]>; - createNasJob( - request: protos.google.cloud.aiplatform.v1.ICreateNasJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.INasJob, - protos.google.cloud.aiplatform.v1.ICreateNasJobRequest|null|undefined, - {}|null|undefined>): void; - createNasJob( - request: protos.google.cloud.aiplatform.v1.ICreateNasJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.INasJob, - protos.google.cloud.aiplatform.v1.ICreateNasJobRequest|null|undefined, - {}|null|undefined>): void; - createNasJob( - request?: protos.google.cloud.aiplatform.v1.ICreateNasJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.INasJob, - protos.google.cloud.aiplatform.v1.ICreateNasJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.INasJob, - protos.google.cloud.aiplatform.v1.ICreateNasJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.INasJob, - protos.google.cloud.aiplatform.v1.ICreateNasJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createNasJob(request, options, callback); - } -/** - * Gets a NasJob - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the NasJob resource. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_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 {@link google.cloud.aiplatform.v1.NasJob | NasJob}. - * Please see the - * [documentation](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_GetNasJob_async - */ - getNasJob( - request?: protos.google.cloud.aiplatform.v1.IGetNasJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.INasJob, - protos.google.cloud.aiplatform.v1.IGetNasJobRequest|undefined, {}|undefined - ]>; - getNasJob( - request: protos.google.cloud.aiplatform.v1.IGetNasJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.INasJob, - protos.google.cloud.aiplatform.v1.IGetNasJobRequest|null|undefined, - {}|null|undefined>): void; - getNasJob( - request: protos.google.cloud.aiplatform.v1.IGetNasJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.INasJob, - protos.google.cloud.aiplatform.v1.IGetNasJobRequest|null|undefined, - {}|null|undefined>): void; - getNasJob( - request?: protos.google.cloud.aiplatform.v1.IGetNasJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.INasJob, - protos.google.cloud.aiplatform.v1.IGetNasJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.INasJob, - protos.google.cloud.aiplatform.v1.IGetNasJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.INasJob, - protos.google.cloud.aiplatform.v1.IGetNasJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getNasJob(request, options, callback); - } -/** - * Cancels a NasJob. - * Starts asynchronous cancellation on the NasJob. The server - * makes a best effort to cancel the job, but success is not - * guaranteed. Clients can use - * {@link google.cloud.aiplatform.v1.JobService.GetNasJob|JobService.GetNasJob} or - * other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On successful cancellation, - * the NasJob is not deleted; instead it becomes a job with - * a {@link google.cloud.aiplatform.v1.NasJob.error|NasJob.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.NasJob.state|NasJob.state} is set to - * `CANCELLED`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the NasJob to cancel. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_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 {@link google.protobuf.Empty | 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_CancelNasJob_async - */ - cancelNasJob( - request?: protos.google.cloud.aiplatform.v1.ICancelNasJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelNasJobRequest|undefined, {}|undefined - ]>; - cancelNasJob( - request: protos.google.cloud.aiplatform.v1.ICancelNasJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelNasJobRequest|null|undefined, - {}|null|undefined>): void; - cancelNasJob( - request: protos.google.cloud.aiplatform.v1.ICancelNasJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelNasJobRequest|null|undefined, - {}|null|undefined>): void; - cancelNasJob( - request?: protos.google.cloud.aiplatform.v1.ICancelNasJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelNasJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelNasJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelNasJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.cancelNasJob(request, options, callback); - } -/** - * Gets a NasTrialDetail. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the NasTrialDetail resource. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.aiplatform.v1.NasTrialDetail | NasTrialDetail}. - * Please see the - * [documentation](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_GetNasTrialDetail_async - */ - getNasTrialDetail( - request?: protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.INasTrialDetail, - protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest|undefined, {}|undefined - ]>; - getNasTrialDetail( - request: protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.INasTrialDetail, - protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest|null|undefined, - {}|null|undefined>): void; - getNasTrialDetail( - request: protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.INasTrialDetail, - protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest|null|undefined, - {}|null|undefined>): void; - getNasTrialDetail( - request?: protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.INasTrialDetail, - protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.INasTrialDetail, - protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.INasTrialDetail, - protos.google.cloud.aiplatform.v1.IGetNasTrialDetailRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getNasTrialDetail(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 {@link google.cloud.aiplatform.v1.BatchPredictionJob | 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 {@link google.cloud.aiplatform.v1.BatchPredictionJob | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob | 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 {@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob | 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 {@link google.protobuf.Empty | 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 {@link google.protobuf.Empty | 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 NasJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the NasJob resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_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_DeleteNasJob_async - */ - deleteNasJob( - request?: protos.google.cloud.aiplatform.v1.IDeleteNasJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteNasJob( - request: protos.google.cloud.aiplatform.v1.IDeleteNasJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteNasJob( - request: protos.google.cloud.aiplatform.v1.IDeleteNasJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteNasJob( - request?: protos.google.cloud.aiplatform.v1.IDeleteNasJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteNasJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteNasJob()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://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_DeleteNasJob_async - */ - async checkDeleteNasJobProgress(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.deleteNasJob, 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1.CustomJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1.CustomJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 - * {@link google.cloud.aiplatform.v1.CustomJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1.DataLabelingJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1.DataLabelingJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 - * {@link google.cloud.aiplatform.v1.DataLabelingJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1.HyperparameterTuningJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1.HyperparameterTuningJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 - * {@link google.cloud.aiplatform.v1.HyperparameterTuningJob | 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 NasJobs 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 NasJobs - * 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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.ListNasJobsResponse.next_page_token|ListNasJobsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1.JobService.ListNasJobs|JobService.ListNasJobs} - * 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 {@link google.cloud.aiplatform.v1.NasJob | NasJob}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listNasJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listNasJobs( - request?: protos.google.cloud.aiplatform.v1.IListNasJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.INasJob[], - protos.google.cloud.aiplatform.v1.IListNasJobsRequest|null, - protos.google.cloud.aiplatform.v1.IListNasJobsResponse - ]>; - listNasJobs( - request: protos.google.cloud.aiplatform.v1.IListNasJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListNasJobsRequest, - protos.google.cloud.aiplatform.v1.IListNasJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.INasJob>): void; - listNasJobs( - request: protos.google.cloud.aiplatform.v1.IListNasJobsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListNasJobsRequest, - protos.google.cloud.aiplatform.v1.IListNasJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.INasJob>): void; - listNasJobs( - request?: protos.google.cloud.aiplatform.v1.IListNasJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListNasJobsRequest, - protos.google.cloud.aiplatform.v1.IListNasJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.INasJob>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListNasJobsRequest, - protos.google.cloud.aiplatform.v1.IListNasJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.INasJob>): - Promise<[ - protos.google.cloud.aiplatform.v1.INasJob[], - protos.google.cloud.aiplatform.v1.IListNasJobsRequest|null, - protos.google.cloud.aiplatform.v1.IListNasJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listNasJobs(request, options, callback); - } - -/** - * Equivalent to `method.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 NasJobs - * 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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.ListNasJobsResponse.next_page_token|ListNasJobsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1.JobService.ListNasJobs|JobService.ListNasJobs} - * 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 {@link google.cloud.aiplatform.v1.NasJob | NasJob} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listNasJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listNasJobsStream( - request?: protos.google.cloud.aiplatform.v1.IListNasJobsRequest, - 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['listNasJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listNasJobs.createStream( - this.innerApiCalls.listNasJobs as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listNasJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with 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 NasJobs - * 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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.ListNasJobsResponse.next_page_token|ListNasJobsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1.JobService.ListNasJobs|JobService.ListNasJobs} - * 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 - * {@link google.cloud.aiplatform.v1.NasJob | NasJob}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see 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_ListNasJobs_async - */ - listNasJobsAsync( - request?: protos.google.cloud.aiplatform.v1.IListNasJobsRequest, - 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['listNasJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listNasJobs.asyncIterate( - this.innerApiCalls['listNasJobs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List top NasTrialDetails of a NasJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the NasJob resource. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_job}` - * @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.ListNasTrialDetailsResponse.next_page_token|ListNasTrialDetailsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1.JobService.ListNasTrialDetails|JobService.ListNasTrialDetails} - * call. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.cloud.aiplatform.v1.NasTrialDetail | NasTrialDetail}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listNasTrialDetailsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listNasTrialDetails( - request?: protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.INasTrialDetail[], - protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest|null, - protos.google.cloud.aiplatform.v1.IListNasTrialDetailsResponse - ]>; - listNasTrialDetails( - request: protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, - protos.google.cloud.aiplatform.v1.IListNasTrialDetailsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.INasTrialDetail>): void; - listNasTrialDetails( - request: protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, - protos.google.cloud.aiplatform.v1.IListNasTrialDetailsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.INasTrialDetail>): void; - listNasTrialDetails( - request?: protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, - protos.google.cloud.aiplatform.v1.IListNasTrialDetailsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.INasTrialDetail>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, - protos.google.cloud.aiplatform.v1.IListNasTrialDetailsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.INasTrialDetail>): - Promise<[ - protos.google.cloud.aiplatform.v1.INasTrialDetail[], - protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest|null, - protos.google.cloud.aiplatform.v1.IListNasTrialDetailsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listNasTrialDetails(request, options, callback); - } - -/** - * Equivalent to `method.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 NasJob resource. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_job}` - * @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.ListNasTrialDetailsResponse.next_page_token|ListNasTrialDetailsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1.JobService.ListNasTrialDetails|JobService.ListNasTrialDetails} - * call. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.cloud.aiplatform.v1.NasTrialDetail | NasTrialDetail} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listNasTrialDetailsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listNasTrialDetailsStream( - request?: protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, - 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['listNasTrialDetails']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listNasTrialDetails.createStream( - this.innerApiCalls.listNasTrialDetails as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listNasTrialDetails`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with 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 NasJob resource. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_job}` - * @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.ListNasTrialDetailsResponse.next_page_token|ListNasTrialDetailsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1.JobService.ListNasTrialDetails|JobService.ListNasTrialDetails} - * call. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.aiplatform.v1.NasTrialDetail | NasTrialDetail}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see 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_ListNasTrialDetails_async - */ - listNasTrialDetailsAsync( - request?: protos.google.cloud.aiplatform.v1.IListNasTrialDetailsRequest, - 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['listNasTrialDetails']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listNasTrialDetails.asyncIterate( - this.innerApiCalls['listNasTrialDetails'] 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1.BatchPredictionJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1.BatchPredictionJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 - * {@link google.cloud.aiplatform.v1.BatchPredictionJob | 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 {@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies | 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 {@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies | 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 - * {@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 - * {@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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/google-cloud-aiplatform/v1/src/v1/job_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_client_config.json deleted file mode 100644 index 32e7535ad87..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_client_config.json +++ /dev/null @@ -1,166 +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" - }, - "CreateNasJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetNasJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListNasJobs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteNasJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelNasJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetNasTrialDetail": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListNasTrialDetails": { - "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/google-cloud-aiplatform/v1/src/v1/job_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_proto_list.json deleted file mode 100644 index b7295bb569f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/job_service_proto_list.json +++ /dev/null @@ -1,115 +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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/metadata_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_client.ts deleted file mode 100644 index 1797b757107..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_client.ts +++ /dev/null @@ -1,6749 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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', 'removeContextChildren', '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 {@link google.cloud.aiplatform.v1.MetadataStore | 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 {@link google.cloud.aiplatform.v1.Artifact | 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 {@link google.cloud.aiplatform.v1.Artifact | 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 {@link google.cloud.aiplatform.v1.Artifact | 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 {@link google.cloud.aiplatform.v1.Context | 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 {@link google.cloud.aiplatform.v1.Context | 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 {@link google.cloud.aiplatform.v1.Context | 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 {@link google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsResponse | 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 {@link google.cloud.aiplatform.v1.AddContextChildrenResponse | 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); - } -/** - * Remove a set of children contexts from a parent Context. If any of the - * child Contexts were NOT added to the parent 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 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 {@link google.cloud.aiplatform.v1.RemoveContextChildrenResponse | RemoveContextChildrenResponse}. - * Please see the - * [documentation](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_RemoveContextChildren_async - */ - removeContextChildren( - request?: protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IRemoveContextChildrenResponse, - protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest|undefined, {}|undefined - ]>; - removeContextChildren( - request: protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IRemoveContextChildrenResponse, - protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest|null|undefined, - {}|null|undefined>): void; - removeContextChildren( - request: protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IRemoveContextChildrenResponse, - protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest|null|undefined, - {}|null|undefined>): void; - removeContextChildren( - request?: protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IRemoveContextChildrenResponse, - protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IRemoveContextChildrenResponse, - protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IRemoveContextChildrenResponse, - protos.google.cloud.aiplatform.v1.IRemoveContextChildrenRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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.removeContextChildren(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 {@link google.cloud.aiplatform.v1.LineageSubgraph | 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 {@link google.cloud.aiplatform.v1.Execution | 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 {@link google.cloud.aiplatform.v1.Execution | 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 {@link google.cloud.aiplatform.v1.Execution | 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 {@link google.cloud.aiplatform.v1.AddExecutionEventsResponse | 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 {@link google.cloud.aiplatform.v1.LineageSubgraph | 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 {@link google.cloud.aiplatform.v1.MetadataSchema | 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 {@link google.cloud.aiplatform.v1.MetadataSchema | 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`). Maximum nested expression depth allowed - * is 5. - * - * 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 {@link google.cloud.aiplatform.v1.LineageSubgraph | 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 {@link google.cloud.aiplatform.v1.MetadataStore | 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 {@link google.cloud.aiplatform.v1.MetadataStore | 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 - * {@link google.cloud.aiplatform.v1.MetadataStore | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.cloud.aiplatform.v1.Artifact | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.cloud.aiplatform.v1.Artifact | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.aiplatform.v1.Artifact | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.cloud.aiplatform.v1.Context | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.cloud.aiplatform.v1.Context | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.aiplatform.v1.Context | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.cloud.aiplatform.v1.Execution | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.cloud.aiplatform.v1.Execution | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.aiplatform.v1.Execution | 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 {@link google.cloud.aiplatform.v1.MetadataSchema | 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 {@link google.cloud.aiplatform.v1.MetadataSchema | 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 - * {@link google.cloud.aiplatform.v1.MetadataSchema | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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/google-cloud-aiplatform/v1/src/v1/metadata_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_client_config.json deleted file mode 100644 index 3c69196d680..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_client_config.json +++ /dev/null @@ -1,154 +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" - }, - "RemoveContextChildren": { - "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/google-cloud-aiplatform/v1/src/v1/metadata_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_proto_list.json deleted file mode 100644 index b7295bb569f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/metadata_service_proto_list.json +++ /dev/null @@ -1,115 +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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/migration_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/migration_service_client.ts deleted file mode 100644 index 735f226331f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/migration_service_client.ts +++ /dev/null @@ -1,3314 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1.MigratableResource | 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 {@link google.cloud.aiplatform.v1.MigratableResource | 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 - * {@link google.cloud.aiplatform.v1.MigratableResource | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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/google-cloud-aiplatform/v1/src/v1/migration_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/migration_service_client_config.json deleted file mode 100644 index 59e4d9aa96f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/src/v1/migration_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/migration_service_proto_list.json deleted file mode 100644 index b7295bb569f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/migration_service_proto_list.json +++ /dev/null @@ -1,115 +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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/model_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_client.ts deleted file mode 100644 index 53a5b599414..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_client.ts +++ /dev/null @@ -1,5134 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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; - const copyModelResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.CopyModelResponse') as gax.protobuf.Type; - const copyModelMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.CopyModelOperationMetadata') 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)), - copyModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - copyModelResponse.decode.bind(copyModelResponse), - copyModelMetadata.decode.bind(copyModelMetadata)) - }; - - // 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', 'copyModel', 'importModelEvaluation', 'batchImportModelEvaluationSlices', 'batchImportEvaluatedAnnotations', '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 {@link google.cloud.aiplatform.v1.Model | 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 {@link google.cloud.aiplatform.v1.Model | 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 {@link google.cloud.aiplatform.v1.Model | 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 {@link google.cloud.aiplatform.v1.ModelEvaluation | 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 {@link google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse | 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); - } -/** - * Imports a list of externally generated EvaluatedAnnotations. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent ModelEvaluationSlice resource. - * Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` - * @param {number[]} request.evaluatedAnnotations - * Required. Evaluated annotations 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 {@link google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsResponse | BatchImportEvaluatedAnnotationsResponse}. - * Please see the - * [documentation](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_BatchImportEvaluatedAnnotations_async - */ - batchImportEvaluatedAnnotations( - request?: protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, - protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest|undefined, {}|undefined - ]>; - batchImportEvaluatedAnnotations( - request: protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, - protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest|null|undefined, - {}|null|undefined>): void; - batchImportEvaluatedAnnotations( - request: protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, - protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest|null|undefined, - {}|null|undefined>): void; - batchImportEvaluatedAnnotations( - request?: protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, - protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, - protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse, - protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.batchImportEvaluatedAnnotations(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 {@link google.cloud.aiplatform.v1.ModelEvaluation | 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 {@link google.cloud.aiplatform.v1.ModelEvaluationSlice | 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 {string} [request.serviceAccount] - * Optional. The user-provided custom service account to use to do the model - * upload. If empty, [Vertex AI Service - * Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) - * will be used. Users uploading the Model must have the - * `iam.serviceAccounts.actAs` permission on this service account. Also, this - * account must belong to the project specified in the `parent` field and have - * all necessary read permissions. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://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 google.cloud.aiplatform.v1.DeployedModel|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 - * [supported export - * format][google.cloud.aiplatform.v1.Model.supported_export_formats]. - * - * @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; - } -/** - * Copies an already existing Vertex AI Model into the specified Location. - * The source Model must exist in the same Project. - * When copying custom Models, the users themselves are responsible for - * {@link google.cloud.aiplatform.v1.Model.metadata|Model.metadata} content to be - * region-agnostic, as well as making sure that any resources (e.g. files) it - * depends on remain accessible. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} [request.modelId] - * Optional. Copy source_model into a new Model with this ID. The ID 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 {string} [request.parentModel] - * Optional. Specify this field to copy source_model into this existing - * Model as a new version. Format: - * `projects/{project}/locations/{location}/models/{model}` - * @param {string} request.parent - * Required. The resource name of the Location into which to copy the Model. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.sourceModel - * Required. The resource name of the Model to copy. That Model must be in the - * same Project. Format: - * `projects/{project}/locations/{location}/models/{model}` - * @param {google.cloud.aiplatform.v1.EncryptionSpec} request.encryptionSpec - * Customer-managed encryption key options. If this is set, - * then the Model copy will be encrypted with the provided encryption key. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://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_CopyModel_async - */ - copyModel( - request?: protos.google.cloud.aiplatform.v1.ICopyModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - copyModel( - request: protos.google.cloud.aiplatform.v1.ICopyModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - copyModel( - request: protos.google.cloud.aiplatform.v1.ICopyModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - copyModel( - request?: protos.google.cloud.aiplatform.v1.ICopyModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.copyModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `copyModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://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_CopyModel_async - */ - async checkCopyModelProgress(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.copyModel, 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 [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"` - * @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 {@link google.cloud.aiplatform.v1.Model | 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 [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"` - * @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 {@link google.cloud.aiplatform.v1.Model | 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 [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"` - * @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 - * {@link google.cloud.aiplatform.v1.Model | 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|next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1.ModelService.ListModelVersions|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 {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` - * - * Example: `update_time asc, 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 {@link google.cloud.aiplatform.v1.Model | 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|next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1.ModelService.ListModelVersions|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 {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` - * - * Example: `update_time asc, 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 {@link google.cloud.aiplatform.v1.Model | 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|next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1.ModelService.ListModelVersions|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 {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` - * - * Example: `update_time asc, 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 - * {@link google.cloud.aiplatform.v1.Model | 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 {@link google.cloud.aiplatform.v1.ModelEvaluation | 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 {@link google.cloud.aiplatform.v1.ModelEvaluation | 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 - * {@link google.cloud.aiplatform.v1.ModelEvaluation | 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 {@link google.cloud.aiplatform.v1.ModelEvaluationSlice | 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 {@link google.cloud.aiplatform.v1.ModelEvaluationSlice | 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 - * {@link google.cloud.aiplatform.v1.ModelEvaluationSlice | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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/google-cloud-aiplatform/v1/src/v1/model_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_client_config.json deleted file mode 100644 index 705668228c5..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_client_config.json +++ /dev/null @@ -1,94 +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" - }, - "CopyModel": { - "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" - }, - "BatchImportEvaluatedAnnotations": { - "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/google-cloud-aiplatform/v1/src/v1/model_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_proto_list.json deleted file mode 100644 index b7295bb569f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/model_service_proto_list.json +++ /dev/null @@ -1,115 +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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/pipeline_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/pipeline_service_client.ts deleted file mode 100644 index 5365d505c6a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/pipeline_service_client.ts +++ /dev/null @@ -1,4265 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1.TrainingPipeline | 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 {@link google.cloud.aiplatform.v1.TrainingPipeline | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1.PipelineJob | 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 {@link google.cloud.aiplatform.v1.PipelineJob | 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 {@link google.protobuf.Empty | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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 {@link google.cloud.aiplatform.v1.TrainingPipeline | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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 {@link google.cloud.aiplatform.v1.TrainingPipeline | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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 - * {@link google.cloud.aiplatform.v1.TrainingPipeline | 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 {@link google.cloud.aiplatform.v1.PipelineJob | 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 {@link google.cloud.aiplatform.v1.PipelineJob | 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 - * {@link google.cloud.aiplatform.v1.PipelineJob | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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/google-cloud-aiplatform/v1/src/v1/pipeline_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/pipeline_service_client_config.json deleted file mode 100644 index 0c4df9123a2..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/src/v1/pipeline_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/pipeline_service_proto_list.json deleted file mode 100644 index b7295bb569f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/pipeline_service_proto_list.json +++ /dev/null @@ -1,115 +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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/prediction_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_client.ts deleted file mode 100644 index 0ea57034d80..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_client.ts +++ /dev/null @@ -1,3030 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, 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}; - 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - 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}' - ), - }; - - // 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' [Model's - * ][google.cloud.aiplatform.v1.DeployedModel.model] - * {@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 {@link google.cloud.aiplatform.v1.PredictResponse | 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 {@link google.api.HttpBody | 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' [Model's - * ][google.cloud.aiplatform.v1.DeployedModel.model] - * {@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 {@link google.cloud.aiplatform.v1.ExplainResponse | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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); - } - - // -------------------- - // -- 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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_client_config.json deleted file mode 100644 index e043161e514..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/src/v1/prediction_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_proto_list.json deleted file mode 100644 index b7295bb569f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/prediction_service_proto_list.json +++ /dev/null @@ -1,115 +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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_client.ts deleted file mode 100644 index faa253d576b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_client.ts +++ /dev/null @@ -1,3564 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1.SpecialistPool | 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 {@link google.cloud.aiplatform.v1.SpecialistPool | 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 {@link google.cloud.aiplatform.v1.SpecialistPool | 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 - * {@link google.cloud.aiplatform.v1.SpecialistPool | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_client_config.json deleted file mode 100644 index a80b72c2db9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_proto_list.json deleted file mode 100644 index b7295bb569f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/specialist_pool_service_proto_list.json +++ /dev/null @@ -1,115 +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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/tensorboard_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_client.ts deleted file mode 100644 index 475f626ed58..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_client.ts +++ /dev/null @@ -1,6135 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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', 'readTensorboardUsage', '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 {@link google.cloud.aiplatform.v1.Tensorboard | 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); - } -/** - * Returns a list of monthly active users for a given TensorBoard instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tensorboard - * 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 {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse | ReadTensorboardUsageResponse}. - * Please see the - * [documentation](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_ReadTensorboardUsage_async - */ - readTensorboardUsage( - request?: protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IReadTensorboardUsageResponse, - protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest|undefined, {}|undefined - ]>; - readTensorboardUsage( - request: protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IReadTensorboardUsageResponse, - protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest|null|undefined, - {}|null|undefined>): void; - readTensorboardUsage( - request: protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IReadTensorboardUsageResponse, - protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest|null|undefined, - {}|null|undefined>): void; - readTensorboardUsage( - request?: protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IReadTensorboardUsageResponse, - protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IReadTensorboardUsageResponse, - protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IReadTensorboardUsageResponse, - protos.google.cloud.aiplatform.v1.IReadTensorboardUsageRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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.readTensorboardUsage(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 becomes 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 {@link google.cloud.aiplatform.v1.TensorboardExperiment | 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 {@link google.cloud.aiplatform.v1.TensorboardExperiment | 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 is overwritten if it's in the mask. If the - * user does not provide a mask then all fields are 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 {@link google.cloud.aiplatform.v1.TensorboardExperiment | 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 becomes 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 {@link google.cloud.aiplatform.v1.TensorboardRun | 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 {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse | 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 {@link google.cloud.aiplatform.v1.TensorboardRun | 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 is overwritten if it's in the mask. If the - * user does not provide a mask then all fields are 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 {@link google.cloud.aiplatform.v1.TensorboardRun | 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 {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse | 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 becomes 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 {@link google.cloud.aiplatform.v1.TensorboardTimeSeries | 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 {@link google.cloud.aiplatform.v1.TensorboardTimeSeries | 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 is overwritten if it's in the mask. If the - * user does not provide a mask then all fields are 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 {@link google.cloud.aiplatform.v1.TensorboardTimeSeries | 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 is returned. - * Otherwise, the number limit of data points is 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 {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse | 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 is returned. Otherwise, 1000 - * data points is 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 {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse | 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 is 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 {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse | 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 is 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 {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse | 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 {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse | 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 is overwritten if it's in the mask. If the - * user does not provide a mask then all fields are 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 are - * returned. The maximum value is 100; values above 100 are 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 {@link google.cloud.aiplatform.v1.Tensorboard | 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 are - * returned. The maximum value is 100; values above 100 are 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 {@link google.cloud.aiplatform.v1.Tensorboard | 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 are - * returned. The maximum value is 100; values above 100 are 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 - * {@link google.cloud.aiplatform.v1.Tensorboard | 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 are returned. The maximum value is 1000; values - * above 1000 are 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 {@link google.cloud.aiplatform.v1.TensorboardExperiment | 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 are returned. The maximum value is 1000; values - * above 1000 are 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 {@link google.cloud.aiplatform.v1.TensorboardExperiment | 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 are returned. The maximum value is 1000; values - * above 1000 are 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 - * {@link google.cloud.aiplatform.v1.TensorboardExperiment | 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 are - * returned. The maximum value is 1000; values above 1000 are 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 {@link google.cloud.aiplatform.v1.TensorboardRun | 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 are - * returned. The maximum value is 1000; values above 1000 are 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 {@link google.cloud.aiplatform.v1.TensorboardRun | 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 are - * returned. The maximum value is 1000; values above 1000 are 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 - * {@link google.cloud.aiplatform.v1.TensorboardRun | 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 are returned. The maximum value is 1000; values - * above 1000 are 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 {@link google.cloud.aiplatform.v1.TensorboardTimeSeries | 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 are returned. The maximum value is 1000; values - * above 1000 are 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 {@link google.cloud.aiplatform.v1.TensorboardTimeSeries | 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 are returned. The maximum value is 1000; values - * above 1000 are 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 - * {@link google.cloud.aiplatform.v1.TensorboardTimeSeries | 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 is 1000. Values must be between 1 and 10000. - * Values above 10000 are coerced to 10000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} - * 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 is 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 {@link google.cloud.aiplatform.v1.TimeSeriesDataPoint | 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 is 1000. Values must be between 1 and 10000. - * Values above 10000 are coerced to 10000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} - * 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 is 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 {@link google.cloud.aiplatform.v1.TimeSeriesDataPoint | 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 is 1000. Values must be between 1 and 10000. - * Values above 10000 are coerced to 10000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} - * 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 is 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 - * {@link google.cloud.aiplatform.v1.TimeSeriesDataPoint | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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/google-cloud-aiplatform/v1/src/v1/tensorboard_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_client_config.json deleted file mode 100644 index 649e11414ce..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_client_config.json +++ /dev/null @@ -1,142 +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" - }, - "ReadTensorboardUsage": { - "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/google-cloud-aiplatform/v1/src/v1/tensorboard_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_proto_list.json deleted file mode 100644 index b7295bb569f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/tensorboard_service_proto_list.json +++ /dev/null @@ -1,115 +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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/src/v1/vizier_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/vizier_service_client.ts deleted file mode 100644 index 5f2f4829e92..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/vizier_service_client.ts +++ /dev/null @@ -1,4388 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - 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: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*/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/*/schedules/*/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 {@link google.cloud.aiplatform.v1.Study | 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 {@link google.cloud.aiplatform.v1.Study | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1.Study | 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 {@link google.cloud.aiplatform.v1.Trial | 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 {@link google.cloud.aiplatform.v1.Trial | 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 {@link google.cloud.aiplatform.v1.Trial | 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 {@link google.cloud.aiplatform.v1.Trial | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1.Trial | 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 {@link google.cloud.aiplatform.v1.ListOptimalTrialsResponse | 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.aiplatform.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 {@link google.cloud.aiplatform.v1.Study | 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 {@link google.cloud.aiplatform.v1.Study | 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 - * {@link google.cloud.aiplatform.v1.Study | 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 {@link google.cloud.aiplatform.v1.Trial | 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 {@link google.cloud.aiplatform.v1.Trial | 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 - * {@link google.cloud.aiplatform.v1.Trial | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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/google-cloud-aiplatform/v1/src/v1/vizier_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/vizier_service_client_config.json deleted file mode 100644 index fe86ba2bb2a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/src/v1/vizier_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/vizier_service_proto_list.json deleted file mode 100644 index b7295bb569f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/src/v1/vizier_service_proto_list.json +++ /dev/null @@ -1,115 +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/evaluated_annotation.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/nas_job.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/service_networking.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/google-cloud-aiplatform/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-aiplatform/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 969ccee3f6a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/google-cloud-aiplatform/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-aiplatform/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index cfd68b24fde..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/google-cloud-aiplatform/v1/system-test/install.ts b/owl-bot-staging/google-cloud-aiplatform/v1/system-test/install.ts deleted file mode 100644 index c8f81b25a86..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/google-cloud-aiplatform/v1/test/gapic_dataset_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_dataset_service_v1.ts deleted file mode 100644 index a810cb7a6f6..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_dataset_service_v1.ts +++ /dev/null @@ -1,4968 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('searchDataItems', () => { - it('invokes searchDataItems 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.SearchDataItemsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.SearchDataItemsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), - ]; - client.innerApiCalls.searchDataItems = stubSimpleCall(expectedResponse); - const [response] = await client.searchDataItems(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchDataItems as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchDataItems as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchDataItems 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.SearchDataItemsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.SearchDataItemsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), - ]; - client.innerApiCalls.searchDataItems = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchDataItems( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IDataItemView[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchDataItems as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchDataItems as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchDataItems 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.SearchDataItemsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.SearchDataItemsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.searchDataItems = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchDataItems(request), expectedError); - const actualRequest = (client.innerApiCalls.searchDataItems as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchDataItems as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchDataItemsStream 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.SearchDataItemsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.SearchDataItemsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), - ]; - client.descriptors.page.searchDataItems.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchDataItemsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.DataItemView[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.DataItemView) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.searchDataItems.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchDataItems, request)); - assert( - (client.descriptors.page.searchDataItems.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes searchDataItemsStream 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.SearchDataItemsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.SearchDataItemsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.searchDataItems.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchDataItemsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.DataItemView[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.DataItemView) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.searchDataItems.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchDataItems, request)); - assert( - (client.descriptors.page.searchDataItems.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with searchDataItems 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.SearchDataItemsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.SearchDataItemsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItemView()), - ]; - client.descriptors.page.searchDataItems.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IDataItemView[] = []; - const iterable = client.searchDataItemsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.searchDataItems.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.searchDataItems.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with searchDataItems 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.SearchDataItemsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.SearchDataItemsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.searchDataItems.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchDataItemsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IDataItemView[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.searchDataItems.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.searchDataItems.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_endpoint_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_endpoint_service_v1.ts deleted file mode 100644 index 6e1b47257cf..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_endpoint_service_v1.ts +++ /dev/null @@ -1,4034 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('mutateDeployedModel', () => { - it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.MutateDeployedModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.mutateDeployedModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.mutateDeployedModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.mutateDeployedModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.MutateDeployedModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.mutateDeployedModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.mutateDeployedModel( - request, - (err?: Error|null, - result?: 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.mutateDeployedModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.MutateDeployedModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.mutateDeployedModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.mutateDeployedModel(request), expectedError); - const actualRequest = (client.innerApiCalls.mutateDeployedModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.MutateDeployedModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.mutateDeployedModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.mutateDeployedModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.mutateDeployedModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkMutateDeployedModelProgress 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.checkMutateDeployedModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkMutateDeployedModelProgress 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.checkMutateDeployedModelProgress(''), 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_featurestore_online_serving_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_featurestore_online_serving_service_v1.ts deleted file mode 100644 index 621797fb4c0..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_featurestore_online_serving_service_v1.ts +++ /dev/null @@ -1,2790 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.WriteFeatureValuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.WriteFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.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.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.WriteFeatureValuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.WriteFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.WriteFeatureValuesResponse() - ); - client.innerApiCalls.writeFeatureValues = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.writeFeatureValues( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.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.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.WriteFeatureValuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.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.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.WriteFeatureValuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.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.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_featurestore_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_featurestore_service_v1.ts deleted file mode 100644 index f518bacdf49..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_featurestore_service_v1.ts +++ /dev/null @@ -1,6209 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('deleteFeatureValues', () => { - it('invokes deleteFeatureValues 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.DeleteFeatureValuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.DeleteFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteFeatureValues = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteFeatureValues(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteFeatureValues 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.DeleteFeatureValuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.DeleteFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteFeatureValues = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteFeatureValues( - request, - (err?: Error|null, - result?: 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.deleteFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteFeatureValues 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.DeleteFeatureValuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.DeleteFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeatureValues = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteFeatureValues(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteFeatureValues 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.DeleteFeatureValuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.DeleteFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteFeatureValues(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteFeatureValuesProgress 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.checkDeleteFeatureValuesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteFeatureValuesProgress 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.checkDeleteFeatureValuesProgress(''), 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_index_endpoint_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_index_endpoint_service_v1.ts deleted file mode 100644 index fe9b05c622b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_index_endpoint_service_v1.ts +++ /dev/null @@ -1,4034 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_index_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_index_service_v1.ts deleted file mode 100644 index 61b90aead63..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_index_service_v1.ts +++ /dev/null @@ -1,3834 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_job_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_job_service_v1.ts deleted file mode 100644 index c3a6f5521dd..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_job_service_v1.ts +++ /dev/null @@ -1,8001 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('createNasJob', () => { - it('invokes createNasJob 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.CreateNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.CreateNasJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.NasJob() - ); - client.innerApiCalls.createNasJob = stubSimpleCall(expectedResponse); - const [response] = await client.createNasJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNasJob 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.CreateNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.CreateNasJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.NasJob() - ); - client.innerApiCalls.createNasJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createNasJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.INasJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNasJob 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.CreateNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.CreateNasJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createNasJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createNasJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNasJob 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.CreateNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.CreateNasJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createNasJob(request), expectedError); - }); - }); - - describe('getNasJob', () => { - it('invokes getNasJob 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.GetNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.GetNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.NasJob() - ); - client.innerApiCalls.getNasJob = stubSimpleCall(expectedResponse); - const [response] = await client.getNasJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNasJob 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.GetNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.GetNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.NasJob() - ); - client.innerApiCalls.getNasJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getNasJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.INasJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNasJob 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.GetNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.GetNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getNasJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getNasJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNasJob 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.GetNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.GetNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getNasJob(request), expectedError); - }); - }); - - describe('cancelNasJob', () => { - it('invokes cancelNasJob 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.CancelNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.CancelNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelNasJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelNasJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelNasJob 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.CancelNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.CancelNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelNasJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelNasJob( - 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.cancelNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelNasJob 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.CancelNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.CancelNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelNasJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelNasJob(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelNasJob 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.CancelNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.CancelNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelNasJob(request), expectedError); - }); - }); - - describe('getNasTrialDetail', () => { - it('invokes getNasTrialDetail 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.GetNasTrialDetailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.GetNasTrialDetailRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.NasTrialDetail() - ); - client.innerApiCalls.getNasTrialDetail = stubSimpleCall(expectedResponse); - const [response] = await client.getNasTrialDetail(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNasTrialDetail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNasTrialDetail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNasTrialDetail 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.GetNasTrialDetailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.GetNasTrialDetailRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.NasTrialDetail() - ); - client.innerApiCalls.getNasTrialDetail = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getNasTrialDetail( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.INasTrialDetail|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNasTrialDetail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNasTrialDetail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNasTrialDetail 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.GetNasTrialDetailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.GetNasTrialDetailRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getNasTrialDetail = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getNasTrialDetail(request), expectedError); - const actualRequest = (client.innerApiCalls.getNasTrialDetail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNasTrialDetail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNasTrialDetail 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.GetNasTrialDetailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.GetNasTrialDetailRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getNasTrialDetail(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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('deleteNasJob', () => { - it('invokes deleteNasJob 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.DeleteNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.DeleteNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteNasJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteNasJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNasJob 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.DeleteNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.DeleteNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteNasJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteNasJob( - request, - (err?: Error|null, - result?: 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.deleteNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNasJob 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.DeleteNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.DeleteNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteNasJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteNasJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNasJob 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.DeleteNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.DeleteNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteNasJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteNasJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteNasJobProgress 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.checkDeleteNasJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteNasJobProgress 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.checkDeleteNasJobProgress(''), 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('listNasJobs', () => { - it('invokes listNasJobs 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.ListNasJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), - ]; - client.innerApiCalls.listNasJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listNasJobs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNasJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNasJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNasJobs 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.ListNasJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), - ]; - client.innerApiCalls.listNasJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listNasJobs( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.INasJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNasJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNasJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNasJobs 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.ListNasJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listNasJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listNasJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listNasJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNasJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNasJobsStream 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.ListNasJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), - ]; - client.descriptors.page.listNasJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listNasJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.NasJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.NasJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listNasJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNasJobs, request)); - assert( - (client.descriptors.page.listNasJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listNasJobsStream 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.ListNasJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listNasJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listNasJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.NasJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.NasJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listNasJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNasJobs, request)); - assert( - (client.descriptors.page.listNasJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listNasJobs 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.ListNasJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), - ]; - client.descriptors.page.listNasJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.INasJob[] = []; - const iterable = client.listNasJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listNasJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listNasJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listNasJobs 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.ListNasJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listNasJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listNasJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.INasJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listNasJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listNasJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listNasTrialDetails', () => { - it('invokes listNasTrialDetails 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.ListNasTrialDetailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasTrialDetailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), - ]; - client.innerApiCalls.listNasTrialDetails = stubSimpleCall(expectedResponse); - const [response] = await client.listNasTrialDetails(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNasTrialDetails as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNasTrialDetails as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNasTrialDetails 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.ListNasTrialDetailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasTrialDetailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), - ]; - client.innerApiCalls.listNasTrialDetails = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listNasTrialDetails( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.INasTrialDetail[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNasTrialDetails as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNasTrialDetails as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNasTrialDetails 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.ListNasTrialDetailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasTrialDetailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listNasTrialDetails = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listNasTrialDetails(request), expectedError); - const actualRequest = (client.innerApiCalls.listNasTrialDetails as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNasTrialDetails as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNasTrialDetailsStream 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.ListNasTrialDetailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasTrialDetailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), - ]; - client.descriptors.page.listNasTrialDetails.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listNasTrialDetailsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.NasTrialDetail[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.NasTrialDetail) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listNasTrialDetails.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNasTrialDetails, request)); - assert( - (client.descriptors.page.listNasTrialDetails.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listNasTrialDetailsStream 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.ListNasTrialDetailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasTrialDetailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listNasTrialDetails.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listNasTrialDetailsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.NasTrialDetail[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.NasTrialDetail) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listNasTrialDetails.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNasTrialDetails, request)); - assert( - (client.descriptors.page.listNasTrialDetails.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listNasTrialDetails 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.ListNasTrialDetailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasTrialDetailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasTrialDetail()), - ]; - client.descriptors.page.listNasTrialDetails.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.INasTrialDetail[] = []; - const iterable = client.listNasTrialDetailsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listNasTrialDetails.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listNasTrialDetails.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listNasTrialDetails 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.ListNasTrialDetailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ListNasTrialDetailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listNasTrialDetails.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listNasTrialDetailsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.INasTrialDetail[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listNasTrialDetails.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listNasTrialDetails.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_metadata_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_metadata_service_v1.ts deleted file mode 100644 index 766030ed96e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_metadata_service_v1.ts +++ /dev/null @@ -1,7350 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('removeContextChildren', () => { - it('invokes removeContextChildren 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.RemoveContextChildrenRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.RemoveContextChildrenRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.RemoveContextChildrenResponse() - ); - client.innerApiCalls.removeContextChildren = stubSimpleCall(expectedResponse); - const [response] = await client.removeContextChildren(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.removeContextChildren as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.removeContextChildren as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes removeContextChildren 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.RemoveContextChildrenRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.RemoveContextChildrenRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.RemoveContextChildrenResponse() - ); - client.innerApiCalls.removeContextChildren = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.removeContextChildren( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IRemoveContextChildrenResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.removeContextChildren as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.removeContextChildren as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes removeContextChildren 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.RemoveContextChildrenRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.RemoveContextChildrenRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.removeContextChildren = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.removeContextChildren(request), expectedError); - const actualRequest = (client.innerApiCalls.removeContextChildren as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.removeContextChildren as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes removeContextChildren 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.RemoveContextChildrenRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.RemoveContextChildrenRequest', ['context']); - request.context = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.removeContextChildren(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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_migration_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_migration_service_v1.ts deleted file mode 100644 index 8dda9321d5a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_migration_service_v1.ts +++ /dev/null @@ -1,3198 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_model_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_model_service_v1.ts deleted file mode 100644 index fd3ad9b2563..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_model_service_v1.ts +++ /dev/null @@ -1,5417 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('batchImportEvaluatedAnnotations', () => { - it('invokes batchImportEvaluatedAnnotations 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.BatchImportEvaluatedAnnotationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsResponse() - ); - client.innerApiCalls.batchImportEvaluatedAnnotations = stubSimpleCall(expectedResponse); - const [response] = await client.batchImportEvaluatedAnnotations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchImportEvaluatedAnnotations 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.BatchImportEvaluatedAnnotationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsResponse() - ); - client.innerApiCalls.batchImportEvaluatedAnnotations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchImportEvaluatedAnnotations( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IBatchImportEvaluatedAnnotationsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchImportEvaluatedAnnotations 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.BatchImportEvaluatedAnnotationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchImportEvaluatedAnnotations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchImportEvaluatedAnnotations(request), expectedError); - const actualRequest = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchImportEvaluatedAnnotations 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.BatchImportEvaluatedAnnotationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchImportEvaluatedAnnotations(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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('copyModel', () => { - it('invokes copyModel 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.CopyModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.CopyModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.copyModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.copyModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.copyModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.copyModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes copyModel 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.CopyModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.CopyModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.copyModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.copyModel( - request, - (err?: Error|null, - result?: 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.copyModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.copyModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes copyModel 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.CopyModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.CopyModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.copyModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.copyModel(request), expectedError); - const actualRequest = (client.innerApiCalls.copyModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.copyModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes copyModel 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.CopyModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.CopyModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.copyModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.copyModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.copyModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.copyModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCopyModelProgress 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.checkCopyModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCopyModelProgress 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.checkCopyModelProgress(''), 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_pipeline_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_pipeline_service_v1.ts deleted file mode 100644 index 2e9306fedbb..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_pipeline_service_v1.ts +++ /dev/null @@ -1,4245 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_prediction_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_prediction_service_v1.ts deleted file mode 100644 index 7d792547802..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_prediction_service_v1.ts +++ /dev/null @@ -1,2787 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_specialist_pool_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_specialist_pool_service_v1.ts deleted file mode 100644 index d22adf84ab2..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_specialist_pool_service_v1.ts +++ /dev/null @@ -1,3618 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_tensorboard_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_tensorboard_service_v1.ts deleted file mode 100644 index a07d0093dea..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_tensorboard_service_v1.ts +++ /dev/null @@ -1,6939 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('readTensorboardUsage', () => { - it('invokes readTensorboardUsage 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.ReadTensorboardUsageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ReadTensorboardUsageRequest', ['tensorboard']); - request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse() - ); - client.innerApiCalls.readTensorboardUsage = stubSimpleCall(expectedResponse); - const [response] = await client.readTensorboardUsage(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.readTensorboardUsage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardUsage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes readTensorboardUsage 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.ReadTensorboardUsageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ReadTensorboardUsageRequest', ['tensorboard']); - request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse() - ); - client.innerApiCalls.readTensorboardUsage = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.readTensorboardUsage( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IReadTensorboardUsageResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.readTensorboardUsage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardUsage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes readTensorboardUsage 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.ReadTensorboardUsageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ReadTensorboardUsageRequest', ['tensorboard']); - request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.readTensorboardUsage = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.readTensorboardUsage(request), expectedError); - const actualRequest = (client.innerApiCalls.readTensorboardUsage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardUsage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes readTensorboardUsage 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.ReadTensorboardUsageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1.ReadTensorboardUsageRequest', ['tensorboard']); - request.tensorboard = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.readTensorboardUsage(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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/test/gapic_vizier_service_v1.ts b/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_vizier_service_v1.ts deleted file mode 100644 index d0c663f4009..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1/test/gapic_vizier_service_v1.ts +++ /dev/null @@ -1,4785 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('.google.cloud.aiplatform.v1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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/google-cloud-aiplatform/v1/tsconfig.json b/owl-bot-staging/google-cloud-aiplatform/v1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1/webpack.config.js b/owl-bot-staging/google-cloud-aiplatform/v1/webpack.config.js deleted file mode 100644 index f4947d41e6b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/.eslintignore b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/.eslintrc.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/.gitignore b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/.jsdoc.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.jsdoc.js deleted file mode 100644 index c805f17d6a9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 2023 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/aiplatform', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/.mocharc.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.mocharc.js deleted file mode 100644 index 1a38f257db7..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/google-cloud-aiplatform/v1beta1/.prettierrc.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/.prettierrc.js deleted file mode 100644 index 55639e70f9e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/google-cloud-aiplatform/v1beta1/README.md b/owl-bot-staging/google-cloud-aiplatform/v1beta1/README.md deleted file mode 100644 index 7f057918e1b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/README.md +++ /dev/null @@ -1 +0,0 @@ -Aiplatform: Nodejs Client diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/linkinator.config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/package.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/package.json deleted file mode 100644 index fef6d91d1e2..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/package.json +++ /dev/null @@ -1,81 +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", - "match service", - "metadata service", - "migration service", - "model service", - "pipeline service", - "prediction service", - "schedule 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.7" - }, - "devDependencies": { - "@types/mocha": "^10.0.1", - "@types/node": "^18.11.18", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^4.0.0", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.1.2", - "mocha": "^10.2.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^15.0.1", - "ts-loader": "^8.4.0", - "typescript": "^4.8.4", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto deleted file mode 100644 index 4e7bf4657eb..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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; - - // Nvidia A100 80GB GPU. - NVIDIA_A100_80GB = 9; - - // Nvidia L4 GPU. - NVIDIA_L4 = 11; - - // TPU v2. - TPU_V2 = 6; - - // TPU v3. - TPU_V3 = 7; - - // TPU v4. - TPU_V4_POD = 10; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation.proto deleted file mode 100644 index a7e494bf10e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation.proto +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto deleted file mode 100644 index 3a25408c438..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/artifact.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/artifact.proto deleted file mode 100644 index 445dfe85b55..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/artifact.proto +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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. - // Top level metadata keys' heading and trailing spaces will be trimmed. - // 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto deleted file mode 100644 index 30e149e6a23..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto +++ /dev/null @@ -1,472 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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]; - } - - // Configuration defining how to transform batch prediction input instances to - // the instances that the Model accepts. - message InstanceConfig { - // The format of the instance that the Model accepts. Vertex AI will - // convert compatible - // [batch prediction input instance - // formats][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.instances_format] - // to the specified format. - // - // Supported values are: - // - // * `object`: Each input is converted to JSON object format. - // * For `bigquery`, each row is converted to an object. - // * For `jsonl`, each line of the JSONL input must be an object. - // * Does not apply to `csv`, `file-list`, `tf-record`, or - // `tf-record-gzip`. - // - // * `array`: Each input is converted to JSON array format. - // * For `bigquery`, each row is converted to an array. The order - // of columns is determined by the BigQuery column order, unless - // [included_fields][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.included_fields] - // is populated. - // [included_fields][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.included_fields] - // must be populated for specifying field orders. - // * For `jsonl`, if each line of the JSONL input is an object, - // [included_fields][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.included_fields] - // must be populated for specifying field orders. - // * Does not apply to `csv`, `file-list`, `tf-record`, or - // `tf-record-gzip`. - // - // If not specified, Vertex AI converts the batch prediction input as - // follows: - // - // * For `bigquery` and `csv`, the behavior is the same as `array`. The - // order of columns is the same as defined in the file or table, unless - // [included_fields][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.included_fields] - // is populated. - // * For `jsonl`, the prediction instance format is determined by - // each line of the input. - // * For `tf-record`/`tf-record-gzip`, each record will be converted to - // an object in the format of `{"b64": }`, where `` is - // the Base64-encoded string of the content of the record. - // * For `file-list`, each file in the list will be converted to an - // object in the format of `{"b64": }`, where `` is - // the Base64-encoded string of the content of the file. - string instance_type = 1; - - // The name of the field that is considered as a key. - // - // The values identified by the key field is not included in the transformed - // instances that is sent to the Model. This is similar to - // specifying this name of the field in - // [excluded_fields][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.excluded_fields]. - // In addition, the batch prediction output will not include the instances. - // Instead the output will only include the value of the key field, in a - // field named `key` in the output: - // - // * For `jsonl` output format, the output will have a `key` field - // instead of the `instance` field. - // * For `csv`/`bigquery` output format, the output will have have a `key` - // column instead of the instance feature columns. - // - // The input must be JSONL with objects at each line, CSV, BigQuery - // or TfRecord. - string key_field = 2; - - // Fields that will be included in the prediction instance that is - // sent to the Model. - // - // If - // [instance_type][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.instance_type] - // is `array`, the order of field names in included_fields also determines - // the order of the values in the array. - // - // When included_fields is populated, - // [excluded_fields][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.excluded_fields] - // must be empty. - // - // The input must be JSONL with objects at each line, CSV, BigQuery - // or TfRecord. - repeated string included_fields = 3; - - // Fields that will be excluded in the prediction instance that is - // sent to the Model. - // - // Excluded will be attached to the batch prediction output if - // [key_field][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.key_field] - // is not specified. - // - // When excluded_fields is populated, - // [included_fields][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InstanceConfig.included_fields] - // must be empty. - // - // The input must be JSONL with objects at each line, CSV, BigQuery - // or TfRecord. - repeated string excluded_fields = 4; - } - - // 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 resource 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. - // Example: `projects/{project}/locations/{location}/models/{model}@2` - // or - // `projects/{project}/locations/{location}/models/{model}@golden` - // if no version is specified, the default version will be deployed. - 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]; - - // Configuration for how to convert batch prediction input instances to the - // prediction instances that are sent to the Model. - InstanceConfig instance_config = 27; - - // 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 Google Cloud 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 Google Cloud 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]; - - // For custom-trained Models and AutoML Tabular Models, the container of the - // DeployedModel instances will send `stderr` and `stdout` streams to - // Cloud Logging by default. Please note that the logs incur cost, - // which are subject to [Cloud Logging - // pricing](https://cloud.google.com/logging/pricing). - // - // User can disable container logging by setting this flag to true. - bool disable_container_logging = 34; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto deleted file mode 100644 index e97245e307a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/context.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/context.proto deleted file mode 100644 index bcfcd3e8987..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/context.proto +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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. - // Top level metadata keys' heading and trailing spaces will be trimmed. - // 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto deleted file mode 100644 index ea44a6b0c5b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 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. -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]; - - // Optional. Whether you want Vertex AI to enable access to the customized - // dashboard in training chief container. - // - // If set to `true`, you can access the dashboard 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_dashboard_access = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Experiment associated with this job. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadataStores}/contexts/{experiment-name}` - string experiment = 17 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - } - ]; - - // Optional. The Experiment Run associated with this job. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadataStores}/contexts/{experiment-name}-{experiment-run-name}` - string experiment_run = 18 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - } - ]; -} - -// 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_item.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_item.proto deleted file mode 100644 index 93e389938e8..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_item.proto +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto deleted file mode 100644 index 42b597f31bf..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto deleted file mode 100644 index 3e293382e06..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/saved_query.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // The description of the Dataset. - string description = 16; - - // 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; - - // All SavedQueries belong to the Dataset will be returned in List/Get - // Dataset response. The annotation_specs field - // will not be populated except for UI cases which will only use - // [annotation_spec_count][google.cloud.aiplatform.v1beta1.SavedQuery.annotation_spec_count]. - // In CreateDataset request, a SavedQuery is created together if - // this field is set, up to one SavedQuery can be set in CreateDatasetRequest. - // The SavedQuery should not contain any AnnotationSpec. - repeated SavedQuery saved_queries = 9; - - // 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; - - // Output only. The resource name of the Artifact that was created in - // MetadataStore when creating the Dataset. The Artifact resource name pattern - // is - // `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`. - string metadata_artifact = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// 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; - - // Labels that will be applied to newly imported Annotations. If two - // Annotations are identical, one of them will be deduped. Two Annotations are - // considered identical if their - // [payload][google.cloud.aiplatform.v1beta1.Annotation.payload], - // [payload_schema_uri][google.cloud.aiplatform.v1beta1.Annotation.payload_schema_uri] - // and all of their - // [labels][google.cloud.aiplatform.v1beta1.Annotation.labels] are the same. - // 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 annotation_labels = 3; - - // 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; - } - - // The instructions how the export data should be split between the - // training, validation and test sets. - oneof split { - // Split based on fractions defining the size of each set. - ExportFractionSplit fraction_split = 5; - } - - // An expression for filtering what part of the Dataset is to be exported. - // Only Annotations 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; -} - -// Assigns the input data to training, validation, and test sets as per the -// given fractions. Any of `training_fraction`, `validation_fraction` and -// `test_fraction` may optionally be provided, they must sum to up to 1. If the -// provided ones sum to less than 1, the remainder is assigned to sets as -// decided by Vertex AI. If none of the fractions are set, by default roughly -// 80% of data is used for training, 10% for validation, and 10% for test. -message ExportFractionSplit { - // The fraction of the input data that is to be used to train the Model. - double training_fraction = 1; - - // The fraction of the input data that is to be used to validate the Model. - double validation_fraction = 2; - - // The fraction of the input data that is to be used to evaluate the Model. - double test_fraction = 3; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto deleted file mode 100644 index b1377b27593..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto +++ /dev/null @@ -1,631 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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"; - } - - // Searches DataItems in a Dataset. - rpc SearchDataItems(SearchDataItemsRequest) - returns (SearchDataItemsResponse) { - option (google.api.http) = { - get: "/v1beta1/{dataset=projects/*/locations/*/datasets/*}:searchDataItems" - }; - } - - // 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.SearchDataItems][google.cloud.aiplatform.v1beta1.DatasetService.SearchDataItems]. -message SearchDataItemsRequest { - // Expression that allows ranking results based on annotation's property. - message OrderByAnnotation { - // Required. Saved query of the Annotation. Only Annotations belong to this - // saved query will be considered for ordering. - string saved_query = 1 [(google.api.field_behavior) = REQUIRED]; - - // A comma-separated list of annotation fields to order by, sorted in - // ascending order. Use "desc" after a field name for descending. Must also - // specify saved_query. - string order_by = 2; - } - - oneof order { - // A comma-separated list of data item fields to order by, sorted in - // ascending order. Use "desc" after a field name for descending. - string order_by_data_item = 12; - - // Expression that allows ranking results based on annotation's property. - OrderByAnnotation order_by_annotation = 13; - } - - // Required. The resource name of the Dataset from which to search DataItems. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}` - string dataset = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - } - ]; - - // The resource name of a SavedQuery(annotation set in UI). - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` - // All of the search will be done in the context of this SavedQuery. - string saved_query = 2 [ - deprecated = true, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/SavedQuery" - } - ]; - - // The resource name of a DataLabelingJob. - // Format: - // `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - // If this field is set, all of the search will be done in the context of - // this DataLabelingJob. - string data_labeling_job = 3; - - // An expression for filtering the DataItem that will be returned. - // - // * `data_item_id` - for = or !=. - // * `labeled` - for = or !=. - // * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that - // have at least one annotation with annotation_spec_id = - // `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. - // - // For example: - // - // * `data_item=1` - // * `has_annotation(5)` - string data_item_filter = 4; - - // An expression for filtering the Annotations that will be returned per - // DataItem. - // * `annotation_spec_id` - for = or !=. - string annotations_filter = 5 [deprecated = true]; - - // An expression that specifies what Annotations will be returned per - // DataItem. Annotations satisfied either of the conditions will be returned. - // * `annotation_spec_id` - for = or !=. - // Must specify `saved_query_id=` - saved query id that annotations should - // belong to. - repeated string annotation_filters = 11; - - // Mask specifying which fields of - // [DataItemView][google.cloud.aiplatform.v1beta1.DataItemView] to read. - google.protobuf.FieldMask field_mask = 6; - - // If set, only up to this many of Annotations will be returned per - // DataItemView. The maximum value is 1000. If not set, the maximum value will - // be used. - int32 annotations_limit = 7; - - // Requested page size. Server may return fewer results than requested. - // Default and maximum page size is 100. - int32 page_size = 8; - - // A comma-separated list of fields to order by, sorted in ascending order. - // Use "desc" after a field name for descending. - string order_by = 9 [deprecated = true]; - - // A token identifying a page of results for the server to return - // Typically obtained via - // [SearchDataItemsResponse.next_page_token][google.cloud.aiplatform.v1beta1.SearchDataItemsResponse.next_page_token] - // of the previous - // [DatasetService.SearchDataItems][google.cloud.aiplatform.v1beta1.DatasetService.SearchDataItems] - // call. - string page_token = 10; -} - -// Response message for -// [DatasetService.SearchDataItems][google.cloud.aiplatform.v1beta1.DatasetService.SearchDataItems]. -message SearchDataItemsResponse { - // The DataItemViews read. - repeated DataItemView data_item_views = 1; - - // A token to retrieve next page of results. - // Pass to - // [SearchDataItemsRequest.page_token][google.cloud.aiplatform.v1beta1.SearchDataItemsRequest.page_token] - // to obtain that page. - string next_page_token = 2; -} - -// A container for a single DataItem and Annotations on it. -message DataItemView { - // The DataItem. - DataItem data_item = 1; - - // The Annotations on the DataItem. If too many Annotations should be returned - // for the DataItem, this field will be truncated per annotations_limit in - // request. If it was, then the has_truncated_annotations will be set to true. - repeated Annotation annotations = 2; - - // True if and only if the Annotations field has been truncated. It happens if - // more Annotations for this DataItem met the request's annotation_filter than - // are allowed to be returned by annotations_limit. - // Note that if Annotations field is not being returned due to field mask, - // then this field will not be set to true no matter how many Annotations are - // there. - bool has_truncated_annotations = 3; -} - -// 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto deleted file mode 100644 index b9659a4dee7..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto deleted file mode 100644 index 68fc304ba68..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto deleted file mode 100644 index bb450ca452b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto deleted file mode 100644 index 63b3c4386d5..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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"; -import "google/protobuf/empty.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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; - - // The total number of DeployedModels on this DeploymentResourcePool. - int32 total_deployed_model_count = 4; - - // The total number of Endpoints that have DeployedModels on this - // DeploymentResourcePool. - int32 total_endpoint_count = 5; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto deleted file mode 100644 index 47788c22202..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto deleted file mode 100644 index 7b787eb9efb..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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}" - pattern: "projects/{project}/locations/{location}/publishers/{publisher}/models/{model}" - }; - - // 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 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; - - // Optional. 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.field_behavior) = OPTIONAL, - (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 - // [JobService.CreateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.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]. - // Required except for Large Model Deploy use cases. - 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. - // Example: `projects/{project}/locations/{location}/models/{model}@2` - // or - // `projects/{project}/locations/{location}/models/{model}@golden` - // 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; - - // If true, deploy the model without explainable feature, regardless the - // existence of - // [Model.explanation_spec][google.cloud.aiplatform.v1beta1.Model.explanation_spec] - // or - // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec]. - bool disable_explanations = 19; - - // 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 Cloud Logging. - // - // Only supported for custom-trained Models and AutoML Tabular Models. - bool enable_container_logging = 12; - - // If true, online prediction access logs are sent to Cloud - // Logging. - // These logs are like standard server access logs, containing - // information like timestamp and latency for each prediction request. - // - // Note that 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto deleted file mode 100644 index f0ed6f97940..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto +++ /dev/null @@ -1,415 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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" - }; - } - - // Updates an existing deployed model. Updatable fields include - // `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, - // `disable_container_logging` (v1 only), and `enable_container_logging` - // (v1beta1 only). - rpc MutateDeployedModel(MutateDeployedModelRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:mutateDeployedModel" - body: "*" - }; - option (google.api.method_signature) = - "endpoint,deployed_model,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "MutateDeployedModelResponse" - metadata_type: "MutateDeployedModelOperationMetadata" - }; - } -} - -// 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. - // - // If the first character is a letter, this value may be up to 63 characters, - // and valid characters are `[a-z0-9-]`. The last character must be a letter - // or number. - // - // If the first character is a number, this value may be up to 9 characters, - // and valid characters are `[0-9]` with no leading zeros. - // - // 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; -} - -// Request message for -// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModel]. -message MutateDeployedModelRequest { - // Required. The name of the Endpoint resource into which to mutate a - // DeployedModel. 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 mutated within the Endpoint. Only the - // following fields can be mutated: - // - // * `min_replica_count` in either - // [DedicatedResources][google.cloud.aiplatform.v1beta1.DedicatedResources] or - // [AutomaticResources][google.cloud.aiplatform.v1beta1.AutomaticResources] - // * `max_replica_count` in either - // [DedicatedResources][google.cloud.aiplatform.v1beta1.DedicatedResources] or - // [AutomaticResources][google.cloud.aiplatform.v1beta1.AutomaticResources] - // * [autoscaling_metric_specs][google.cloud.aiplatform.v1beta1.DedicatedResources.autoscaling_metric_specs] - // * `disable_container_logging` (v1 only) - // * `enable_container_logging` (v1beta1 only) - DeployedModel deployed_model = 2 [(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 = 4 - [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for -// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModel]. -message MutateDeployedModelResponse { - // The DeployedModel that's being mutated. - DeployedModel deployed_model = 1; -} - -// Runtime operation information for -// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModel]. -message MutateDeployedModelOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/entity_type.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/entity_type.proto deleted file mode 100644 index 40070774212..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/entity_type.proto +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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]; - - // Optional. Config for data retention policy in offline storage. - // TTL in days for feature values that will be stored in offline storage. - // The Feature Store offline storage periodically removes obsolete feature - // values older than `offline_storage_ttl_days` since the feature generation - // time. If unset (or explicitly set to 0), default to 4000 days TTL. - int32 offline_storage_ttl_days = 10 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/env_var.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/env_var.proto deleted file mode 100644 index aa61f4a2d5a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/env_var.proto +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto deleted file mode 100644 index 239b55cdb6b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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.proto"; -import "google/protobuf/struct.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -option java_multiple_files = true; -option java_outer_classname = "EvaluatedAnnotationProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// True positive, false positive, or false negative. -// -// EvaluatedAnnotation is only available under ModelEvaluationSlice with slice -// of `annotationSpec` dimension. -message EvaluatedAnnotation { - // Describes the type of the EvaluatedAnnotation. The type is determined - enum EvaluatedAnnotationType { - // Invalid value. - EVALUATED_ANNOTATION_TYPE_UNSPECIFIED = 0; - - // The EvaluatedAnnotation is a true positive. It has a prediction created - // by the Model and a ground truth Annotation which the prediction matches. - TRUE_POSITIVE = 1; - - // The EvaluatedAnnotation is false positive. It has a prediction created by - // the Model which does not match any ground truth annotation. - FALSE_POSITIVE = 2; - - // The EvaluatedAnnotation is false negative. It has a ground truth - // annotation which is not matched by any of the model created predictions. - FALSE_NEGATIVE = 3; - } - - // Output only. Type of the EvaluatedAnnotation. - EvaluatedAnnotationType type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The model predicted annotations. - // - // For true positive, there is one and only one prediction, which matches the - // only one ground truth annotation in - // [ground_truths][google.cloud.aiplatform.v1beta1.EvaluatedAnnotation.ground_truths]. - // - // For false positive, there is one and only one prediction, which doesn't - // match any ground truth annotation of the corresponding - // [data_item_view_id][EvaluatedAnnotation.data_item_view_id]. - // - // For false negative, there are zero or more predictions which are similar to - // the only ground truth annotation in - // [ground_truths][google.cloud.aiplatform.v1beta1.EvaluatedAnnotation.ground_truths] - // but not enough for a match. - // - // The schema of the prediction is stored in - // [ModelEvaluation.annotation_schema_uri][] - repeated google.protobuf.Value predictions = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The ground truth Annotations, i.e. the Annotations that exist - // in the test data the Model is evaluated on. - // - // For true positive, there is one and only one ground truth annotation, which - // matches the only prediction in - // [predictions][google.cloud.aiplatform.v1beta1.EvaluatedAnnotation.predictions]. - // - // For false positive, there are zero or more ground truth annotations that - // are similar to the only prediction in - // [predictions][google.cloud.aiplatform.v1beta1.EvaluatedAnnotation.predictions], - // but not enough for a match. - // - // For false negative, there is one and only one ground truth annotation, - // which doesn't match any predictions created by the model. - // - // The schema of the ground truth is stored in - // [ModelEvaluation.annotation_schema_uri][] - repeated google.protobuf.Value ground_truths = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The data item payload that the Model predicted this - // EvaluatedAnnotation on. - google.protobuf.Value data_item_payload = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. ID of the EvaluatedDataItemView under the same ancestor - // ModelEvaluation. The EvaluatedDataItemView consists of all ground truths - // and predictions on - // [data_item_payload][google.cloud.aiplatform.v1beta1.EvaluatedAnnotation.data_item_payload]. - string evaluated_data_item_view_id = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Explanations of - // [predictions][google.cloud.aiplatform.v1beta1.EvaluatedAnnotation.predictions]. - // Each element of the explanations indicates the explanation for one - // explanation Method. - // - // The attributions list in the - // [EvaluatedAnnotationExplanation.explanation][google.cloud.aiplatform.v1beta1.EvaluatedAnnotationExplanation.explanation] - // object corresponds to the - // [predictions][google.cloud.aiplatform.v1beta1.EvaluatedAnnotation.predictions] - // list. For example, the second element in the attributions list explains the - // second element in the predictions list. - repeated EvaluatedAnnotationExplanation explanations = 8; - - // Annotations of model error analysis results. - repeated ErrorAnalysisAnnotation error_analysis_annotations = 9; -} - -// Explanation result of the prediction produced by the Model. -message EvaluatedAnnotationExplanation { - // Explanation type. - // - // For AutoML Image Classification models, possible values are: - // - // * `image-integrated-gradients` - // * `image-xrai` - string explanation_type = 1; - - // Explanation attribution response details. - Explanation explanation = 2; -} - -// Model error analysis for each annotation. -message ErrorAnalysisAnnotation { - // Attributed items for a given annotation, typically representing neighbors - // from the training sets constrained by the query type. - message AttributedItem { - // The unique ID for each annotation. Used by FE to allocate the annotation - // in DB. - string annotation_resource_name = 1; - - // The distance of this item to the annotation. - double distance = 2; - } - - // The query type used for finding the attributed items. - enum QueryType { - // Unspecified query type for model error analysis. - QUERY_TYPE_UNSPECIFIED = 0; - - // Query similar samples across all classes in the dataset. - ALL_SIMILAR = 1; - - // Query similar samples from the same class of the input sample. - SAME_CLASS_SIMILAR = 2; - - // Query dissimilar samples from the same class of the input sample. - SAME_CLASS_DISSIMILAR = 3; - } - - // Attributed items for a given annotation, typically representing neighbors - // from the training sets constrained by the query type. - repeated AttributedItem attributed_items = 1; - - // The query type used for finding the attributed items. - QueryType query_type = 2; - - // The outlier score of this annotated item. Usually defined as the min of all - // distances from attributed items. - double outlier_score = 3; - - // The threshold used to determine if this annotation is an outlier or not. - double outlier_threshold = 4; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/event.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/event.proto deleted file mode 100644 index 22a229fa440..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/event.proto +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/execution.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/execution.proto deleted file mode 100644 index da68119786c..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/execution.proto +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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. - // Top level metadata keys' heading and trailing spaces will be trimmed. - // 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto deleted file mode 100644 index 6a0e8bfab31..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto +++ /dev/null @@ -1,569 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 full configuration for the generated index, the semantics are the - // same as [metadata][google.cloud.aiplatform.v1beta1.Index.metadata] and - // should match - // [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config). - google.protobuf.Value nearest_neighbor_search_config = 2; - - // Simplified preset configuration, which automatically sets configuration - // values based on the desired query speed-precision trade-off and modality. - Presets presets = 4; - } - - // The Cloud Storage locations that contain the instances to be - // indexed for approximate nearest neighbor search. - GcsSource gcs_source = 1; - - // The number of neighbors to return when querying for examples. - 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. - 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 speed-precision trade-off when - // querying for examples. If omitted, defaults to `PRECISE`. - optional Query query = 1; - - // The modality of the uploaded model, which automatically configures the - // distance measurement and feature normalization for the underlying example - // index and queries. If your model does not precisely fit one of these types, - // it is okay to choose the closest type. - 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 - // attribution 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto deleted file mode 100644 index 25ba8a41739..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto +++ /dev/null @@ -1,424 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto deleted file mode 100644 index c37b23c9ed8..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 - // [SnapshotAnalysis][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis] - // or - // [ImportFeaturesAnalysis][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.ImportFeaturesAnalysis] - // 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 - // [SnapshotAnalysis][google.cloud.aiplatform.v1beta1.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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto deleted file mode 100644 index f1caf42c9bb..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_selector.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_selector.proto deleted file mode 100644 index a44e9f0249d..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_selector.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore.proto deleted file mode 100644 index b935b273666..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore.proto +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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; - - // Optional. The cpu utilization that the Autoscaler should be trying to - // achieve. This number is on a scale from 0 (no utilization) to 100 - // (total utilization), and is limited between 10 and 80. When a cluster's - // CPU utilization exceeds the target that you have set, Bigtable - // immediately adds nodes to the cluster. When CPU utilization is - // substantially lower than the target, Bigtable removes nodes. If not set - // or set to 0, default to 50. - int32 cpu_utilization_target = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // 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. The field should not - // co-exist with the field of `OnlineStoreReplicationConfig`. If both of it - // and OnlineStoreReplicationConfig are unset, the feature store 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. TTL in days for feature values that will be stored in online - // serving storage. The Feature Store online storage periodically removes - // obsolete feature values older than `online_storage_ttl_days` since the - // feature generation time. Note that `online_storage_ttl_days` should be less - // than or equal to `offline_storage_ttl_days` for each EntityType under a - // featurestore. If not set, default to 4000 days - int32 online_storage_ttl_days = 13 [(google.api.field_behavior) = OPTIONAL]; - - // 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto deleted file mode 100644 index 134f109416d..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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. - // If both - // [monitoring_interval_days][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days] - // and the deprecated `monitoring_interval` field - // are set when creating/updating EntityTypes/Features, - // [monitoring_interval_days][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days] - // will be used. - google.protobuf.Duration monitoring_interval = 2 [deprecated = true]; - - // Configuration of the snapshot analysis based monitoring pipeline - // running interval. The value indicates number of days. - 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][google.cloud.aiplatform.v1beta1.FeaturestoreService.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][google.cloud.aiplatform.v1beta1.FeaturestoreService.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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto deleted file mode 100644 index 5c26efb6f16..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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.EntityView.data][google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse.EntityView.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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto deleted file mode 100644 index f4ec90768c2..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto +++ /dev/null @@ -1,1444 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/type/interval.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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" - }; - } - - // Delete Feature values from Featurestore. - // - // The progress of the deletion is tracked by the returned operation. The - // deleted feature values are guaranteed to be invisible to subsequent read - // operations after the operation is marked as successfully done. - // - // If a delete feature values operation fails, the feature values - // returned from reads and exports may be inconsistent. If consistency is - // required, the caller must retry the same delete request again and wait till - // the new operation returned is marked as successfully done. - rpc DeleteFeatureValues(DeleteFeatureValuesRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:deleteFeatureValues" - body: "*" - }; - option (google.api.method_signature) = "entity_type"; - option (google.longrunning.operation_info) = { - response_type: "DeleteFeatureValuesResponse" - metadata_type: "DeleteFeatureValuesOperationMetadata" - }; - } - - // 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` - // * `online_storage_ttl_days` - 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; - - // The number rows that weren't ingested due to having feature timestamps - // outside the retention boundary. - int64 timestamp_outside_retention_rows_count = 4; -} - -// 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. - repeated EntityTypeSpec entity_type_specs = 7 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. 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 = 11 - [(google.api.field_behavior) = OPTIONAL]; -} - -// 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` - // * `offline_storage_ttl_days` - 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 128 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 source URI from where Feature values are imported. - repeated string source_uris = 4; - - // 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; - - // The number rows that weren't ingested due to having timestamps outside the - // retention boundary. - int64 timestamp_outside_retention_rows_count = 7; -} - -// 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 delete Feature values. -message DeleteFeatureValuesOperationMetadata { - // Operation metadata for Featurestore delete 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; -} - -// Request message for -// [FeaturestoreService.DeleteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.DeleteFeatureValues]. -message DeleteFeatureValuesRequest { - // Message to select entity. - // If an entity id is selected, all the feature values corresponding to the - // entity id will be deleted, including the entityId. - message SelectEntity { - // Required. Selectors choosing feature values of which entity id to be - // deleted from the EntityType. - EntityIdSelector entity_id_selector = 1 - [(google.api.field_behavior) = REQUIRED]; - } - - // Message to select time range and feature. - // Values of the selected feature generated within an inclusive time range - // will be deleted. Using this option permanently deletes the feature values - // from the specified feature IDs within the specified time range. - // This might include data from the online storage. If you want to retain - // any deleted historical data in the online storage, you must re-ingest it. - message SelectTimeRangeAndFeature { - // Required. Select feature generated within a half-inclusive time range. - // The time range is lower inclusive and upper exclusive. - google.type.Interval time_range = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. Selectors choosing which feature values to be deleted from the - // EntityType. - FeatureSelector feature_selector = 2 - [(google.api.field_behavior) = REQUIRED]; - - // If set, data will not be deleted from online storage. - // When time range is older than the data in online storage, setting this to - // be true will make the deletion have no impact on online serving. - bool skip_online_storage_delete = 3; - } - - // Defines options to select feature values to be deleted. - oneof DeleteOption { - // Select feature values to be deleted by specifying entities. - SelectEntity select_entity = 2; - - // Select feature values to be deleted by specifying time range and - // features. - SelectTimeRangeAndFeature select_time_range_and_feature = 3; - } - - // Required. The resource name of the EntityType grouping the Features for - // which values are being deleted from. 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" - } - ]; -} - -// Response message for -// [FeaturestoreService.DeleteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.DeleteFeatureValues]. -message DeleteFeatureValuesResponse { - // Response message if the request uses the SelectEntity option. - message SelectEntity { - // The count of deleted entity rows in the offline storage. - // Each row corresponds to the combination of an entity ID and a timestamp. - // One entity ID can have multiple rows in the offline storage. - int64 offline_storage_deleted_entity_row_count = 1; - - // The count of deleted entities in the online storage. - // Each entity ID corresponds to one entity. - int64 online_storage_deleted_entity_count = 2; - } - - // Response message if the request uses the SelectTimeRangeAndFeature option. - message SelectTimeRangeAndFeature { - // The count of the features or columns impacted. - // This is the same as the feature count in the request. - int64 impacted_feature_count = 1; - - // The count of modified entity rows in the offline storage. - // Each row corresponds to the combination of an entity ID and a timestamp. - // One entity ID can have multiple rows in the offline storage. - // Within each row, only the features specified in the request are - // deleted. - int64 offline_storage_modified_entity_row_count = 2; - - // The count of modified entities in the online storage. - // Each entity ID corresponds to one entity. - // Within each entity, only the features specified in the request are - // deleted. - int64 online_storage_modified_entity_count = 3; - } - - // Response based on which delete option is specified in the - // request - oneof response { - // Response for request specifying the entities to delete - SelectEntity select_entity = 1; - - // Response for request specifying time range and feature - SelectTimeRangeAndFeature select_time_range_and_feature = 2; - } -} - -// Selector for entityId. Getting ids from the given source. -message EntityIdSelector { - // Details about the source data, including the location of the storage and - // the format. - oneof EntityIdsSource { - // Source of Csv - CsvSource csv_source = 3; - } - - // Source column that holds entity IDs. If not provided, entity IDs are - // extracted from the column named `entity_id`. - string entity_id_field = 5; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto deleted file mode 100644 index 83d2697a596..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto deleted file mode 100644 index bd37178673b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto deleted file mode 100644 index ef2efb41c65..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/cloud/aiplatform/v1beta1/service_networking.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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]; - - // Optional. Configuration for private service connect. - // - // [network][google.cloud.aiplatform.v1beta1.IndexEndpoint.network] and - // [private_service_connect_config][google.cloud.aiplatform.v1beta1.IndexEndpoint.private_service_connect_config] - // are mutually exclusive. - PrivateServiceConnectConfig private_service_connect_config = 12 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, the deployed index will be accessible through public - // endpoint. - bool public_endpoint_enabled = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. If - // [public_endpoint_enabled][google.cloud.aiplatform.v1beta1.IndexEndpoint.public_endpoint_enabled] - // is true, this field will be populated with the domain name to use for this - // index endpoint. - string public_endpoint_domain_name = 14 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// 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 for SMALL shard: - // e2-standard-2 and all machine types available for MEDIUM and LARGE shard. - // - // Available machine types for MEDIUM shard: - // e2-standard-16 and all machine types available for LARGE shard. - // - // Available machine types for LARGE shard: - // e2-highmem-16, n2d-standard-32. - // - // n1-standard-16 and n1-standard-32 are still available, but we recommend - // e2-standard-16 and e2-highmem-16 for cost efficiency. - DedicatedResources dedicated_resources = 16 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, private endpoint's access logs are sent to Cloud - // Logging. - // - // These logs are like standard server access logs, containing - // information like timestamp and latency for each MatchRequest. - // - // Note that 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 should 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto deleted file mode 100644 index 14d6fc58e00..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto +++ /dev/null @@ -1,362 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_service.proto deleted file mode 100644 index 6bbb3dda0bc..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_service.proto +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/io.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/io.proto deleted file mode 100644 index d9ed3c4581d..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/io.proto +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto deleted file mode 100644 index f0668a63137..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto +++ /dev/null @@ -1,1372 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/nas_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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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," - "https://www.googleapis.com/auth/cloud-platform.read-only"; - - // 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 NasJob - rpc CreateNasJob(CreateNasJobRequest) returns (NasJob) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/nasJobs" - body: "nas_job" - }; - option (google.api.method_signature) = "parent,nas_job"; - } - - // Gets a NasJob - rpc GetNasJob(GetNasJobRequest) returns (NasJob) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/nasJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists NasJobs in a Location. - rpc ListNasJobs(ListNasJobsRequest) returns (ListNasJobsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/nasJobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a NasJob. - rpc DeleteNasJob(DeleteNasJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/nasJobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Cancels a NasJob. - // Starts asynchronous cancellation on the NasJob. The server - // makes a best effort to cancel the job, but success is not - // guaranteed. Clients can use - // [JobService.GetNasJob][google.cloud.aiplatform.v1beta1.JobService.GetNasJob] - // or other methods to check whether the cancellation succeeded or whether the - // job completed despite cancellation. On successful cancellation, - // the NasJob is not deleted; instead it becomes a job with - // a [NasJob.error][google.cloud.aiplatform.v1beta1.NasJob.error] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`, and - // [NasJob.state][google.cloud.aiplatform.v1beta1.NasJob.state] is set to - // `CANCELLED`. - rpc CancelNasJob(CancelNasJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/nasJobs/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Gets a NasTrialDetail. - rpc GetNasTrialDetail(GetNasTrialDetailRequest) returns (NasTrialDetail) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/nasJobs/*/nasTrialDetails/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List top NasTrialDetails of a NasJob. - rpc ListNasTrialDetails(ListNasTrialDetailsRequest) - returns (ListNasTrialDetailsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/nasJobs/*}/nasTrialDetails" - }; - option (google.api.method_signature) = "parent"; - } - - // 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. - // * `labels` supports general map functions that is: - // `labels.key=value` - key:value equality - // `labels.key:* - key existence - // - // 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"` - // * `labels.keyA=valueA` - // * `labels.keyB:*` - 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. - // * `labels` supports general map functions that is: - // `labels.key=value` - key:value equality - // `labels.key:* - key existence - // - // 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"` - // * `labels.keyA=valueA` - // * `labels.keyB:*` - 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. - // * `labels` supports general map functions that is: - // `labels.key=value` - key:value equality - // `labels.key:* - key existence - // - // 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"` - // * `labels.keyA=valueA` - // * `labels.keyB:*` - 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.CreateNasJob][google.cloud.aiplatform.v1beta1.JobService.CreateNasJob]. -message CreateNasJobRequest { - // Required. The resource name of the Location to create the NasJob 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 NasJob to create. - NasJob nas_job = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [JobService.GetNasJob][google.cloud.aiplatform.v1beta1.JobService.GetNasJob]. -message GetNasJobRequest { - // Required. The name of the NasJob resource. - // Format: - // `projects/{project}/locations/{location}/nasJobs/{nas_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/NasJob" - } - ]; -} - -// Request message for -// [JobService.ListNasJobs][google.cloud.aiplatform.v1beta1.JobService.ListNasJobs]. -message ListNasJobsRequest { - // Required. The resource name of the Location to list the NasJobs - // 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. - // * `labels` supports general map functions that is: - // `labels.key=value` - key:value equality - // `labels.key:* - key existence - // - // 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"` - // * `labels.keyA=valueA` - // * `labels.keyB:*` - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListNasJobsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListNasJobsResponse.next_page_token] - // of the previous - // [JobService.ListNasJobs][google.cloud.aiplatform.v1beta1.JobService.ListNasJobs] - // call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for -// [JobService.ListNasJobs][google.cloud.aiplatform.v1beta1.JobService.ListNasJobs] -message ListNasJobsResponse { - // List of NasJobs in the requested page. - // [NasJob.nas_job_output][google.cloud.aiplatform.v1beta1.NasJob.nas_job_output] - // of the jobs will not be returned. - repeated NasJob nas_jobs = 1; - - // A token to retrieve the next page of results. - // Pass to - // [ListNasJobsRequest.page_token][google.cloud.aiplatform.v1beta1.ListNasJobsRequest.page_token] - // to obtain that page. - string next_page_token = 2; -} - -// Request message for -// [JobService.DeleteNasJob][google.cloud.aiplatform.v1beta1.JobService.DeleteNasJob]. -message DeleteNasJobRequest { - // Required. The name of the NasJob resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/nasJobs/{nas_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/NasJob" - } - ]; -} - -// Request message for -// [JobService.CancelNasJob][google.cloud.aiplatform.v1beta1.JobService.CancelNasJob]. -message CancelNasJobRequest { - // Required. The name of the NasJob to cancel. - // Format: - // `projects/{project}/locations/{location}/nasJobs/{nas_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/NasJob" - } - ]; -} - -// Request message for -// [JobService.GetNasTrialDetail][google.cloud.aiplatform.v1beta1.JobService.GetNasTrialDetail]. -message GetNasTrialDetailRequest { - // Required. The name of the NasTrialDetail resource. - // Format: - // `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/NasTrialDetail" - } - ]; -} - -// Request message for -// [JobService.ListNasTrialDetails][google.cloud.aiplatform.v1beta1.JobService.ListNasTrialDetails]. -message ListNasTrialDetailsRequest { - // Required. The name of the NasJob resource. - // Format: - // `projects/{project}/locations/{location}/nasJobs/{nas_job}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/NasJob" - } - ]; - - // The standard list page size. - int32 page_size = 2; - - // The standard list page token. - // Typically obtained via - // [ListNasTrialDetailsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListNasTrialDetailsResponse.next_page_token] - // of the previous - // [JobService.ListNasTrialDetails][google.cloud.aiplatform.v1beta1.JobService.ListNasTrialDetails] - // call. - string page_token = 3; -} - -// Response message for -// [JobService.ListNasTrialDetails][google.cloud.aiplatform.v1beta1.JobService.ListNasTrialDetails] -message ListNasTrialDetailsResponse { - // List of top NasTrials in the requested page. - repeated NasTrialDetail nas_trial_details = 1; - - // A token to retrieve the next page of results. - // Pass to - // [ListNasTrialDetailsRequest.page_token][google.cloud.aiplatform.v1beta1.ListNasTrialDetailsRequest.page_token] - // to obtain that page. - string next_page_token = 2; -} - -// 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. - // * `labels` supports general map functions that is: - // `labels.key=value` - key:value equality - // `labels.key:* - key existence - // - // 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"` - // * `labels.keyA=valueA` - // * `labels.keyB:*` - 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 effect 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. - // * `labels` supports general map functions that is: - // `labels.key=value` - key:value equality - // `labels.key:* - key existence - // - // 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"` - // * `labels.keyA=valueA` - // * `labels.keyB:*` - 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_state.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_state.proto deleted file mode 100644 index d06cc9c1773..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_state.proto +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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. Only jobs in the `RUNNING` state can be updated. - // After updating, the job goes back to the `RUNNING` state. - JOB_STATE_UPDATING = 10; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto deleted file mode 100644 index 3e7e99a3b53..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto deleted file mode 100644 index 098ca31b443..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto deleted file mode 100644 index 59eec695498..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/match_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/match_service.proto deleted file mode 100644 index 88f1ba11b45..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/match_service.proto +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -option java_multiple_files = true; -option java_outer_classname = "MatchServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// MatchService is a Google managed service for efficient vector similarity -// search at scale. -service MatchService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Finds the nearest neighbors of each vector within the request. - rpc FindNeighbors(FindNeighborsRequest) returns (FindNeighborsResponse) { - option (google.api.http) = { - post: "/v1beta1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:findNeighbors" - body: "*" - }; - } - - // Reads the datapoints/vectors of the given IDs. - // A maximum of 1000 datapoints can be retrieved in a batch. - rpc ReadIndexDatapoints(ReadIndexDatapointsRequest) - returns (ReadIndexDatapointsResponse) { - option (google.api.http) = { - post: "/v1beta1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:readIndexDatapoints" - body: "*" - }; - } -} - -// The request message for -// [MatchService.FindNeighbors][google.cloud.aiplatform.v1beta1.MatchService.FindNeighbors]. -message FindNeighborsRequest { - // A query to find a number of the nearest neighbors (most similar vectors) - // of a vector. - message Query { - // Required. The datapoint/vector whose nearest neighbors should be searched - // for. - IndexDatapoint datapoint = 1 [(google.api.field_behavior) = REQUIRED]; - - // The number of nearest neighbors to be retrieved from database for each - // query. If not set, will use the default from the service configuration - // (https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes#nearest-neighbor-search-config). - int32 neighbor_count = 2; - - // Crowding 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. - // It's used for improving result diversity. - // This field is the maximum number of matches with the same crowding tag. - int32 per_crowding_attribute_neighbor_count = 3; - - // The number of neighbors to find via approximate search before - // exact reordering is performed. If not set, the default value from scam - // config is used; if set, this value must be > 0. - int32 approximate_neighbor_count = 4; - - // The fraction of the number of leaves to search, set at query time allows - // user to tune search performance. This value increase result in both - // search accuracy and latency increase. The value should be between 0.0 - // and 1.0. If not set or set to 0.0, query uses the default value specified - // in - // NearestNeighborSearchConfig.TreeAHConfig.fraction_leaf_nodes_to_search. - double fraction_leaf_nodes_to_search_override = 5; - } - - // Required. The name of the index endpoint. - // 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" - } - ]; - - // The ID of the DeployedIndex that will serve the request. This request is - // sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That - // IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index - // has a DeployedIndex.id field. - // The value of the field below must equal one of the DeployedIndex.id - // fields of the IndexEndpoint that is being called for this request. - string deployed_index_id = 2; - - // The list of queries. - repeated Query queries = 3; - - // If set to true, the full datapoints (including all vector values and - // restricts) of the nearest neighbors are returned. - // Note that returning full datapoint will significantly increase the - // latency and cost of the query. - bool return_full_datapoint = 4; -} - -// The response message for -// [MatchService.FindNeighbors][google.cloud.aiplatform.v1beta1.MatchService.FindNeighbors]. -message FindNeighborsResponse { - // A neighbor of the query vector. - message Neighbor { - // The datapoint of the neighbor. - // Note that full datapoints are returned only when "return_full_datapoint" - // is set to true. Otherwise, only the "datapoint_id" and "crowding_tag" - // fields are populated. - IndexDatapoint datapoint = 1; - - // The distance between the neighbor and the query vector. - double distance = 2; - } - - // Nearest neighbors for one query. - message NearestNeighbors { - // The ID of the query datapoint. - string id = 1; - - // All its neighbors. - repeated Neighbor neighbors = 2; - } - - // The nearest neighbors of the query datapoints. - repeated NearestNeighbors nearest_neighbors = 1; -} - -// The request message for -// [MatchService.ReadIndexDatapoints][google.cloud.aiplatform.v1beta1.MatchService.ReadIndexDatapoints]. -message ReadIndexDatapointsRequest { - // Required. The name of the index endpoint. - // 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" - } - ]; - - // The ID of the DeployedIndex that will serve the request. - string deployed_index_id = 2; - - // IDs of the datapoints to be searched for. - repeated string ids = 3; -} - -// The response message for -// [MatchService.ReadIndexDatapoints][google.cloud.aiplatform.v1beta1.MatchService.ReadIndexDatapoints]. -message ReadIndexDatapointsResponse { - // The result list of datapoints. - repeated IndexDatapoint datapoints = 1; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto deleted file mode 100644 index 01d3bdde90d..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto deleted file mode 100644 index 74ecdb97318..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto +++ /dev/null @@ -1,1392 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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"; - } - - // Remove a set of children contexts from a parent Context. If any of the - // child Contexts were NOT added to the parent Context, they are - // simply skipped. - rpc RemoveContextChildren(RemoveContextChildrenRequest) - returns (RemoveContextChildrenResponse) { - option (google.api.http) = { - post: "/v1beta1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:removeContextChildren" - 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`). Maximum nested expression depth allowed - // is 5. - // - // For example: `display_name = "test" AND metadata.field1.bool_value = true`. - string filter = 4; - - // How the list of messages is ordered. Specify the values to order by and an - // ordering operation. The default sorting order is ascending. To specify - // descending order for a field, users append a " desc" suffix; for example: - // "foo desc, bar". - // Subfields are specified with a `.` character, such as foo.bar. - // see https://google.aip.dev/132#ordering for more details. - string order_by = 5; -} - -// 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`). Maximum nested expression depth allowed - // is 5. - // - // For example: `display_name = "test" AND metadata.field1.bool_value = true`. - string filter = 4; - - // How the list of messages is ordered. Specify the values to order by and an - // ordering operation. The default sorting order is ascending. To specify - // descending order for a field, users append a " desc" suffix; for example: - // "foo desc, bar". - // Subfields are specified with a `.` character, such as foo.bar. - // see https://google.aip.dev/132#ordering for more details. - string order_by = 5; -} - -// 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.DeleteContextChildrenRequest][]. -message RemoveContextChildrenRequest { - // 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.RemoveContextChildren][google.cloud.aiplatform.v1beta1.MetadataService.RemoveContextChildren]. -message RemoveContextChildrenResponse {} - -// 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`). Maximum nested expression depth allowed - // is 5. - // - // For example: `display_name = "test" AND metadata.field1.bool_value = true`. - string filter = 4; - - // How the list of messages is ordered. Specify the values to order by and an - // ordering operation. The default sorting order is ascending. To specify - // descending order for a field, users append a " desc" suffix; for example: - // "foo desc, bar". - // Subfields are specified with a `.` character, such as foo.bar. - // see https://google.aip.dev/132#ordering for more details. - string order_by = 5; -} - -// 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`). Maximum nested expression depth allowed - // is 5. - // - // For example: `display_name = "test" AND metadata.field1.bool_value = true`. - string filter = 3; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_store.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_store.proto deleted file mode 100644 index c4d16500e66..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_store.proto +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto deleted file mode 100644 index 907f06c237e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/migration_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/migration_service.proto deleted file mode 100644 index f67773bc787..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/migration_service.proto +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto deleted file mode 100644 index 6293bfa22f4..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto +++ /dev/null @@ -1,727 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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]; - } - - // Contains information about the original Model if this Model is a copy. - message OriginalModelInfo { - // Output only. The resource name of the Model this Model is a copy of, - // including the revision. Format: - // `projects/{project}/locations/{location}/models/{model_id}@{version_id}` - string model = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - } - - // 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 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 or Large 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 or Large 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][google.cloud.aiplatform.v1beta1.PredictionService.Explain] - // after being - // [deployed][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel] if - // it is populated. The Model can be used for [batch - // explanation][google.cloud.aiplatform.v1beta1.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][google.cloud.aiplatform.v1beta1.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][google.cloud.aiplatform.v1beta1.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; - - // Output only. Source of a model. It can either be automl training pipeline, - // custom training pipeline, BigQuery ML, or existing Vertex AI Model. - ModelSourceInfo model_source_info = 38 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If this Model is a copy of another Model, this contains info - // about the original. - OriginalModelInfo original_model_info = 34 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The resource name of the Artifact that was created in - // MetadataStore when creating the Model. The Artifact resource name pattern - // is - // `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`. - string metadata_artifact = 44 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// 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; -} - -// Detail description of the source information of the model. -message ModelSourceInfo { - // Source of the model. - enum ModelSourceType { - // Should not be used. - MODEL_SOURCE_TYPE_UNSPECIFIED = 0; - - // The Model is uploaded by automl training pipeline. - AUTOML = 1; - - // The Model is uploaded by user or custom training pipeline. - CUSTOM = 2; - - // The Model is registered and sync'ed from BigQuery ML. - BQML = 3; - - // The Model is saved or tuned from Model Garden. - MODEL_GARDEN = 4; - - // The Model is saved or tuned from Genie. - GENIE = 5; - } - - // Type of the model source. - ModelSourceType source_type = 1; - - // If this Model is copy of another Model. If true then - // [source_type][google.cloud.aiplatform.v1beta1.ModelSourceInfo.source_type] - // pertains to the original. - bool copy = 2; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto deleted file mode 100644 index b28a4e6ac71..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto deleted file mode 100644 index 862679989fc..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto deleted file mode 100644 index e1aba074a85..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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"; -import "google/protobuf/wrappers.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 { - // Specification for how the data should be sliced. - message SliceSpec { - // Specification message containing the config for this SliceSpec. - // When `kind` is selected as `value` and/or `range`, only a single slice - // will be computed. - // When `all_values` is present, a separate slice will be computed for - // each possible label/value for the corresponding key in `config`. - // Examples, with feature zip_code with values 12345, 23334, 88888 and - // feature country with values "US", "Canada", "Mexico" in the dataset: - // - // Example 1: - // - // { - // "zip_code": { "value": { "float_value": 12345.0 } } - // } - // - // A single slice for any data with zip_code 12345 in the dataset. - // - // Example 2: - // - // { - // "zip_code": { "range": { "low": 12345, "high": 20000 } } - // } - // - // A single slice containing data where the zip_codes between 12345 and - // 20000 For this example, data with the zip_code of 12345 will be in this - // slice. - // - // Example 3: - // - // { - // "zip_code": { "range": { "low": 10000, "high": 20000 } }, - // "country": { "value": { "string_value": "US" } } - // } - // - // A single slice containing data where the zip_codes between 10000 and - // 20000 has the country "US". For this example, data with the zip_code of - // 12345 and country "US" will be in this slice. - // - // Example 4: - // - // { "country": {"all_values": { "value": true } } } - // - // Three slices are computed, one for each unique country in the dataset. - // - // Example 5: - // - // { - // "country": { "all_values": { "value": true } }, - // "zip_code": { "value": { "float_value": 12345.0 } } - // } - // - // Three slices are computed, one for each unique country in the dataset - // where the zip_code is also 12345. For this example, data with zip_code - // 12345 and country "US" will be in one slice, zip_code 12345 and country - // "Canada" in another slice, and zip_code 12345 and country "Mexico" in - // another slice, totaling 3 slices. - message SliceConfig { - oneof kind { - // A unique specific value for a given feature. - // Example: `{ "value": { "string_value": "12345" } }` - Value value = 1; - - // A range of values for a numerical feature. - // Example: `{"range":{"low":10000.0,"high":50000.0}}` - // will capture 12345 and 23334 in the slice. - Range range = 2; - - // If all_values is set to true, then all possible labels of the keyed - // feature will have another slice computed. - // Example: `{"all_values":{"value":true}}` - google.protobuf.BoolValue all_values = 3; - } - } - - // A range of values for slice(s). - // `low` is inclusive, `high` is exclusive. - message Range { - // Inclusive low value for the range. - float low = 1; - - // Exclusive high value for the range. - float high = 2; - } - - // Single value that supports strings and floats. - message Value { - oneof kind { - // String type. - string string_value = 1; - - // Float type. - float float_value = 2; - } - } - - // Mapping configuration for this SliceSpec. - // The key is the name of the feature. - // By default, the key will be prefixed by "instance" as a dictionary - // prefix for Vertex Batch Predictions output format. - map configs = 1; - } - - // 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]. - // * `slice`: This slice is a user customized slice defined by its - // SliceSpec. - 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. Specification for how the data was sliced. - SliceSpec slice_spec = 3 [(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]; - - // Output only. 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 tabular - // Models. - ModelExplanation model_explanation = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto deleted file mode 100644 index 372c27ffa8e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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"; -option (google.api.resource_definition) = { - type: "monitoring.googleapis.com/NotificationChannel" - pattern: "projects/{project}/notificationChannels/{notification_channel}" -}; - -// 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; - - // Resource names of the NotificationChannels to send alert. - // Must be of the format - // `projects//notificationChannels/` - repeated string notification_channels = 3 [(google.api.resource_reference) = { - type: "monitoring.googleapis.com/NotificationChannel" - }]; -} - -// 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto deleted file mode 100644 index 49eaee8e2cb..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto +++ /dev/null @@ -1,902 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/encryption_spec.proto"; -import "google/cloud/aiplatform/v1beta1/evaluated_annotation.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/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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][google.cloud.aiplatform.v1beta1.DeployedModel] 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" - }; - } - - // Copies an already existing Vertex AI Model into the specified Location. - // The source Model must exist in the same Project. - // When copying custom Models, the users themselves are responsible for - // [Model.metadata][google.cloud.aiplatform.v1beta1.Model.metadata] content to - // be region-agnostic, as well as making sure that any resources (e.g. files) - // it depends on remain accessible. - rpc CopyModel(CopyModelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/models:copy" - body: "*" - }; - option (google.api.method_signature) = "parent,source_model"; - option (google.longrunning.operation_info) = { - response_type: "CopyModelResponse" - metadata_type: "CopyModelOperationMetadata" - }; - } - - // 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"; - } - - // Imports a list of externally generated EvaluatedAnnotations. - rpc BatchImportEvaluatedAnnotations(BatchImportEvaluatedAnnotationsRequest) - returns (BatchImportEvaluatedAnnotationsResponse) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/models/*/evaluations/*/slices/*}:batchImport" - body: "*" - }; - option (google.api.method_signature) = "parent,evaluated_annotations"; - } - - // 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]; - - // Optional. The user-provided custom service account to use to do the model - // upload. If empty, [Vertex AI Service - // Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) - // will be used. Users uploading the Model must have the - // `iam.serviceAccounts.actAs` permission on this service account. Also, this - // account must belong to the project specified in the `parent` field and have - // all necessary read permissions. - string service_account = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// 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 - // [next_page_token][google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token] - // of the previous - // [ListModelVersions][google.cloud.aiplatform.v1beta1.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; - - // 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` - // - // Example: `update_time asc, create_time desc`. - string order_by = 6; -} - -// 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.CopyModel][google.cloud.aiplatform.v1beta1.ModelService.CopyModel]. -message CopyModelRequest { - // If both fields are unset, a new Model will be created with a generated ID. - oneof destination_model { - // Optional. Copy source_model into a new Model with this ID. The ID 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 = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specify this field to copy source_model into this existing - // Model as a new version. Format: - // `projects/{project}/locations/{location}/models/{model}` - string parent_model = 5 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - } - - // Required. The resource name of the Location into which to copy the Model. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The resource name of the Model to copy. That Model must be in the - // same Project. Format: - // `projects/{project}/locations/{location}/models/{model}` - string source_model = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - - // Customer-managed encryption key options. If this is set, - // then the Model copy will be encrypted with the provided encryption key. - EncryptionSpec encryption_spec = 3; -} - -// Details of -// [ModelService.CopyModel][google.cloud.aiplatform.v1beta1.ModelService.CopyModel] -// operation. -message CopyModelOperationMetadata { - // The common part of the operation metadata. - GenericOperationMetadata generic_metadata = 1; -} - -// Response message of -// [ModelService.CopyModel][google.cloud.aiplatform.v1beta1.ModelService.CopyModel] -// operation. -message CopyModelResponse { - // The name of the copied 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 copied. - string model_version_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// 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.BatchImportEvaluatedAnnotations][google.cloud.aiplatform.v1beta1.ModelService.BatchImportEvaluatedAnnotations] -message BatchImportEvaluatedAnnotationsRequest { - // Required. The name of the parent ModelEvaluationSlice resource. - // Format: - // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelEvaluationSlice" - } - ]; - - // Required. Evaluated annotations resource to be imported. - repeated EvaluatedAnnotation evaluated_annotations = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for -// [ModelService.BatchImportEvaluatedAnnotations][google.cloud.aiplatform.v1beta1.ModelService.BatchImportEvaluatedAnnotations] -message BatchImportEvaluatedAnnotationsResponse { - // Output only. Number of EvaluatedAnnotations imported. - int32 imported_evaluated_annotations_count = 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/nas_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/nas_job.proto deleted file mode 100644 index 01c07031796..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/nas_job.proto +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -option java_multiple_files = true; -option java_outer_classname = "NasJobProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Represents a Neural Architecture Search (NAS) job. -message NasJob { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/NasJob" - pattern: "projects/{project}/locations/{location}/nasJobs/{nas_job}" - }; - - // Output only. Resource name of the NasJob. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The display name of the NasJob. - // 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]; - - // Required. The specification of a NasJob. - NasJobSpec nas_job_spec = 4 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Output of the NasJob. - NasJobOutput nas_job_output = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The detailed state of the job. - JobState state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the NasJob was created. - google.protobuf.Timestamp create_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the NasJob for the first time entered the - // `JOB_STATE_RUNNING` state. - google.protobuf.Timestamp start_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the NasJob entered any of the following states: - // `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. - google.protobuf.Timestamp end_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the NasJob was most recently updated. - google.protobuf.Timestamp update_time = 10 - [(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 = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize NasJobs. - // - // 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 = 12; - - // Customer-managed encryption key options for a NasJob. - // If this is set, then all resources created by the NasJob - // will be encrypted with the provided encryption key. - EncryptionSpec encryption_spec = 13; - - // Optional. Enable a separation of Custom model training - // and restricted image training for tenant project. - bool enable_restricted_image_training = 14 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; -} - -// Represents a NasTrial details along with it's parameters. If there is a -// corresponding train NasTrial, the train NasTrial is also returned. -message NasTrialDetail { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/NasTrialDetail" - pattern: "projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}" - }; - - // Output only. Resource name of the NasTrialDetail. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The parameters for the NasJob NasTrial. - string parameters = 2; - - // The requested search NasTrial. - NasTrial search_trial = 3; - - // The train NasTrial corresponding to - // [search_trial][google.cloud.aiplatform.v1beta1.NasTrialDetail.search_trial]. - // Only populated if - // [search_trial][google.cloud.aiplatform.v1beta1.NasTrialDetail.search_trial] - // is used for training. - NasTrial train_trial = 4; -} - -// Represents the spec of a NasJob. -message NasJobSpec { - // The spec of multi-trial Neural Architecture Search (NAS). - message MultiTrialAlgorithmSpec { - // 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. - string metric_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The optimization goal of the metric. - GoalType goal = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Represent spec for search trials. - message SearchTrialSpec { - // Required. The spec of a search trial job. The same spec applies to - // all search trials. - CustomJobSpec search_trial_job_spec = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The maximum number of Neural Architecture Search (NAS) trials - // to run. - int32 max_trial_count = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The maximum number of trials to run in parallel. - int32 max_parallel_trial_count = 3 - [(google.api.field_behavior) = REQUIRED]; - - // The number of failed trials that need to be seen before failing - // the NasJob. - // - // If set to 0, Vertex AI decides how many trials must fail - // before the whole job fails. - int32 max_failed_trial_count = 4; - } - - // Represent spec for train trials. - message TrainTrialSpec { - // Required. The spec of a train trial job. The same spec applies to - // all train trials. - CustomJobSpec train_trial_job_spec = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The maximum number of trials to run in parallel. - int32 max_parallel_trial_count = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Required. Frequency of search trials to start train stage. Top N - // [TrainTrialSpec.max_parallel_trial_count] - // search trials will be trained for every M - // [TrainTrialSpec.frequency] trials searched. - int32 frequency = 3 [(google.api.field_behavior) = REQUIRED]; - } - - // The available types of multi-trial algorithms. - enum MultiTrialAlgorithm { - // Defaults to `REINFORCEMENT_LEARNING`. - MULTI_TRIAL_ALGORITHM_UNSPECIFIED = 0; - - // The Reinforcement Learning Algorithm for Multi-trial Neural - // Architecture Search (NAS). - REINFORCEMENT_LEARNING = 1; - - // The Grid Search Algorithm for Multi-trial Neural - // Architecture Search (NAS). - GRID_SEARCH = 2; - } - - // The multi-trial Neural Architecture Search (NAS) algorithm - // type. Defaults to `REINFORCEMENT_LEARNING`. - MultiTrialAlgorithm multi_trial_algorithm = 1; - - // Metric specs for the NAS job. - // Validation for this field is done at `multi_trial_algorithm_spec` field. - MetricSpec metric = 2; - - // Required. Spec for search trials. - SearchTrialSpec search_trial_spec = 3 - [(google.api.field_behavior) = REQUIRED]; - - // Spec for train trials. Top N [TrainTrialSpec.max_parallel_trial_count] - // search trials will be trained for every M - // [TrainTrialSpec.frequency] trials searched. - TrainTrialSpec train_trial_spec = 4; - } - - // The Neural Architecture Search (NAS) algorithm specification. - oneof nas_algorithm_spec { - // The spec of multi-trial algorithms. - MultiTrialAlgorithmSpec multi_trial_algorithm_spec = 2; - } - - // The ID of the existing NasJob in the same Project and Location - // which will be used to resume search. search_space_spec and - // nas_algorithm_spec are obtained from previous NasJob hence should not - // provide them again for this NasJob. - string resume_nas_job_id = 3; - - // It defines the search space for Neural Architecture Search (NAS). - string search_space_spec = 1; -} - -// Represents a uCAIP NasJob output. -message NasJobOutput { - // The output of a multi-trial Neural Architecture Search (NAS) jobs. - message MultiTrialJobOutput { - // Output only. List of NasTrials that were started as part of search stage. - repeated NasTrial search_trials = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. List of NasTrials that were started as part of train stage. - repeated NasTrial train_trials = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // The output of this Neural Architecture Search (NAS) job. - oneof output { - // Output only. The output of this multi-trial Neural Architecture Search - // (NAS) job. - MultiTrialJobOutput multi_trial_job_output = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } -} - -// Represents a uCAIP NasJob trial. -message NasTrial { - // Describes a NasTrial state. - enum State { - // The NasTrial state is unspecified. - STATE_UNSPECIFIED = 0; - - // Indicates that a specific NasTrial has been requested, but it has not yet - // been suggested by the service. - REQUESTED = 1; - - // Indicates that the NasTrial has been suggested. - ACTIVE = 2; - - // Indicates that the NasTrial should stop according to the service. - STOPPING = 3; - - // Indicates that the NasTrial is completed successfully. - SUCCEEDED = 4; - - // Indicates that the NasTrial should not be attempted again. - // The service will set a NasTrial to INFEASIBLE when it's done but missing - // the final_measurement. - INFEASIBLE = 5; - } - - // Output only. The identifier of the NasTrial assigned by the service. - string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The detailed state of the NasTrial. - State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The final measurement containing the objective value. - Measurement final_measurement = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the NasTrial was started. - google.protobuf.Timestamp start_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the NasTrial's status changed to `SUCCEEDED` or - // `INFEASIBLE`. - google.protobuf.Timestamp end_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/operation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/operation.proto deleted file mode 100644 index 965d57a61b9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/operation.proto +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 Google Cloud 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_failure_policy.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_failure_policy.proto deleted file mode 100644 index 14501c2f954..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_failure_policy.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto deleted file mode 100644 index 75171c649f2..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto +++ /dev/null @@ -1,409 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 { - // 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.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; - - // 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 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 Google Cloud - // 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 - // [pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_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" - } - ]; - - // Output only. The names of the previously failed - // [CustomJob][google.cloud.aiplatform.v1beta1.CustomJob] for the main - // container executions. The list includes the all attempts in chronological - // order. - repeated string failed_main_jobs = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The names of the previously failed - // [CustomJob][google.cloud.aiplatform.v1beta1.CustomJob] for the - // pre-caching-check container executions. 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. The list - // includes the all attempts in chronological order. - repeated string failed_pre_caching_check_jobs = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // The detailed info for a custom job executor. - message CustomJobDetail { - // 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" - } - ]; - - // Output only. The names of the previously failed - // [CustomJob][google.cloud.aiplatform.v1beta1.CustomJob]. The list includes - // the all attempts in chronological order. - repeated string failed_jobs = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - 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 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto deleted file mode 100644 index ef695f43b93..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto +++ /dev/null @@ -1,450 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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. - // * `labels` supports general map functions that is: - // `labels.key=value` - key:value equality - // `labels.key:* - key existence - // - // 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; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 7; -} - -// 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto deleted file mode 100644 index d7cf152d66f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto deleted file mode 100644 index b6d2c16ffb8..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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: "*" - additional_bindings { - post: "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}: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: "*" - additional_bindings { - post: "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}: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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/saved_query.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/saved_query.proto deleted file mode 100644 index d2abc05388a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/saved_query.proto +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule.proto deleted file mode 100644 index ad02ad01d2b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule.proto +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/pipeline_service.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -option java_multiple_files = true; -option java_outer_classname = "ScheduleProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// An instance of a Schedule periodically schedules runs to make API calls based -// on user specified time specification and API request type. -message Schedule { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Schedule" - pattern: "projects/{project}/locations/{location}/schedules/{schedule}" - }; - - // Status of a scheduled run. - message RunResponse { - // The scheduled run time based on the user-specified schedule. - google.protobuf.Timestamp scheduled_run_time = 1; - - // The response of the scheduled run. - string run_response = 2; - } - - // Possible state of the schedule. - enum State { - // Unspecified. - STATE_UNSPECIFIED = 0; - - // The Schedule is active. Runs are being scheduled on the user-specified - // timespec. - ACTIVE = 1; - - // The schedule is paused. No new runs will be created until the schedule - // is resumed. Already started runs will be allowed to complete. - PAUSED = 2; - - // The Schedule is completed. No new runs will be scheduled. Already started - // runs will be allowed to complete. Schedules in completed state cannot be - // paused or resumed. - COMPLETED = 3; - } - - // Required. - // The time specification to launch scheduled runs. - oneof time_specification { - // Cron schedule (https://en.wikipedia.org/wiki/Cron) to launch scheduled - // runs. To explicitly set a timezone to the cron tab, apply a prefix in the - // cron tab: "CRON_TZ=${IANA_TIME_ZONE}" or "TZ=${IANA_TIME_ZONE}". - // The ${IANA_TIME_ZONE} may only be a valid string from IANA time zone - // database. For example, "CRON_TZ=America/New_York 1 * * * *", or - // "TZ=America/New_York 1 * * * *". - string cron = 10; - } - - // Required. - // The API request template to launch the scheduled runs. - // User-specified ID is not supported in the request template. - oneof request { - // Request for - // [PipelineService.CreatePipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.CreatePipelineJob]. - // CreatePipelineJobRequest.parent field is required (format: - // projects/{project}/locations/{location}). - CreatePipelineJobRequest create_pipeline_job_request = 14; - } - - // Output only. The resource name of the Schedule. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. User provided name of the Schedule. - // 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]; - - // Optional. Timestamp after which the first run can be scheduled. - // Default to Schedule create time if not specified. - google.protobuf.Timestamp start_time = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Timestamp after which no new runs can be scheduled. - // If specified, The schedule will be completed when either - // end_time is reached or when scheduled_run_count >= max_run_count. - // If not specified, new runs will keep getting scheduled until this Schedule - // is paused or deleted. Already scheduled runs will be allowed to complete. - // Unset if not specified. - google.protobuf.Timestamp end_time = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Maximum run count of the schedule. - // If specified, The schedule will be completed when either - // started_run_count >= max_run_count or when end_time is reached. - // If not specified, new runs will keep getting scheduled until this Schedule - // is paused or deleted. Already scheduled runs will be allowed to complete. - // Unset if not specified. - int64 max_run_count = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The number of runs started by this schedule. - int64 started_run_count = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The state of this Schedule. - State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Schedule was created. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Schedule was updated. - google.protobuf.Timestamp update_time = 19 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Schedule should schedule the next run. - // Having a next_run_time in the past means the runs are being started - // behind schedule. - google.protobuf.Timestamp next_run_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Schedule was last paused. - // Unset if never paused. - google.protobuf.Timestamp last_pause_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Schedule was last resumed. - // Unset if never resumed from pause. - google.protobuf.Timestamp last_resume_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Maximum number of runs that can be started concurrently for this - // Schedule. This is the limit for starting the scheduled requests and not the - // execution of the operations/jobs created by the requests (if applicable). - int64 max_concurrent_run_count = 11 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Whether new scheduled runs can be queued when max_concurrent_runs - // limit is reached. If set to true, new runs will be queued instead of - // skipped. Default to false. - bool allow_queueing = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Whether to backfill missed runs when the schedule is resumed - // from PAUSED state. If set to true, all missed runs will be scheduled. New - // runs will be scheduled after the backfill is complete. Default to false. - bool catch_up = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Response of the last scheduled run. - // This is the response for starting the scheduled requests and not the - // execution of the operations/jobs created by the requests (if applicable). - // Unset if no run has been scheduled yet. - RunResponse last_scheduled_run_response = 18 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule_service.proto deleted file mode 100644 index 234dcece3c2..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schedule_service.proto +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/schedule.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -option java_multiple_files = true; -option java_outer_classname = "ScheduleServiceProto"; -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 Schedule resources to -// periodically launch shceudled runs to make API calls. -service ScheduleService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a Schedule. - rpc CreateSchedule(CreateScheduleRequest) returns (Schedule) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/schedules" - body: "schedule" - }; - option (google.api.method_signature) = "parent,schedule"; - } - - // Deletes a Schedule. - rpc DeleteSchedule(DeleteScheduleRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/schedules/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Gets a Schedule. - rpc GetSchedule(GetScheduleRequest) returns (Schedule) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/schedules/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Schedules in a Location. - rpc ListSchedules(ListSchedulesRequest) returns (ListSchedulesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/schedules" - }; - option (google.api.method_signature) = "parent"; - } - - // Pauses a Schedule. Will mark - // [Schedule.state][google.cloud.aiplatform.v1beta1.Schedule.state] to - // 'PAUSED'. If the schedule is paused, no new runs will be created. Already - // created runs will NOT be paused or canceled. - rpc PauseSchedule(PauseScheduleRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/schedules/*}:pause" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Resumes a paused Schedule to start scheduling new runs. Will mark - // [Schedule.state][google.cloud.aiplatform.v1beta1.Schedule.state] to - // 'ACTIVE'. Only paused Schedule can be resumed. - // - // When the Schedule is resumed, new runs will be scheduled starting from the - // next execution time after the current time based on the time_specification - // in the Schedule. If [Schedule.catchUp][] is set up true, all - // missed runs will be scheduled for backfill first. - rpc ResumeSchedule(ResumeScheduleRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/schedules/*}:resume" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.api.method_signature) = "name,catch_up"; - } -} - -// Request message for -// [ScheduleService.CreateSchedule][google.cloud.aiplatform.v1beta1.ScheduleService.CreateSchedule]. -message CreateScheduleRequest { - // Required. The resource name of the Location to create the Schedule 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 Schedule to create. - Schedule schedule = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [ScheduleService.GetSchedule][google.cloud.aiplatform.v1beta1.ScheduleService.GetSchedule]. -message GetScheduleRequest { - // Required. The name of the Schedule resource. - // Format: - // `projects/{project}/locations/{location}/schedules/{schedule}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Schedule" - } - ]; -} - -// Request message for -// [ScheduleService.ListSchedules][google.cloud.aiplatform.v1beta1.ScheduleService.ListSchedules]. -message ListSchedulesRequest { - // Required. The resource name of the Location to list the Schedules 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 Schedules that match the filter expression. The following - // fields are supported: - // - // * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. - // * `state`: Supports `=` and `!=` comparisons. - // * `request`: Supports existence of the check. - // (e.g. `create_pipeline_job_request:*` --> Schedule has - // create_pipeline_job_request). - // * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - // Values must be in RFC 3339 format. - // * `start_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - // Values must be in RFC 3339 format. - // * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, `>=` comparisons and `:*` - // existence check. Values must be in RFC 3339 format. - // * `next_run_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` - // comparisons. Values must be in RFC 3339 format. - // - // - // Filter expressions can be combined together using logical operators - // (`NOT`, `AND` & `OR`). - // The syntax to define filter expression is based on - // https://google.aip.dev/160. - // - // Examples: - // - // * `state="ACTIVE" AND display_name:"my_schedule_*"` - // * `NOT display_name="my_schedule"` - // * `create_time>"2021-05-18T00:00:00Z"` - // * `end_time>"2021-05-18T00:00:00Z" OR NOT end_time:*` - // * `create_pipeline_job_request:*` - string filter = 2; - - // The standard list page size. - // Default to 100 if not specified. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListSchedulesResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListSchedulesResponse.next_page_token] - // of the previous - // [ScheduleService.ListSchedules][google.cloud.aiplatform.v1beta1.ScheduleService.ListSchedules] - // 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. - // - // For example, using "create_time desc, end_time" will order results by - // create time in descending order, and if there are multiple schedules 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 with create_time in - // descending order. - // - // Supported fields: - // * `create_time` - // * `start_time` - // * `end_time` - // * `next_run_time` - string order_by = 5; -} - -// Response message for -// [ScheduleService.ListSchedules][google.cloud.aiplatform.v1beta1.ScheduleService.ListSchedules] -message ListSchedulesResponse { - // List of Schedules in the requested page. - repeated Schedule schedules = 1; - - // A token to retrieve the next page of results. - // Pass to - // [ListSchedulesRequest.page_token][google.cloud.aiplatform.v1beta1.ListSchedulesRequest.page_token] - // to obtain that page. - string next_page_token = 2; -} - -// Request message for -// [ScheduleService.DeleteSchedule][google.cloud.aiplatform.v1beta1.ScheduleService.DeleteSchedule]. -message DeleteScheduleRequest { - // Required. The name of the Schedule resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/schedules/{schedule}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Schedule" - } - ]; -} - -// Request message for -// [ScheduleService.PauseSchedule][google.cloud.aiplatform.v1beta1.ScheduleService.PauseSchedule]. -message PauseScheduleRequest { - // Required. The name of the Schedule resource to be paused. - // Format: - // `projects/{project}/locations/{location}/schedules/{schedule}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Schedule" - } - ]; -} - -// Request message for -// [ScheduleService.ResumeSchedule][google.cloud.aiplatform.v1beta1.ScheduleService.ResumeSchedule]. -message ResumeScheduleRequest { - // Required. The name of the Schedule resource to be resumed. - // Format: - // `projects/{project}/locations/{location}/schedules/{schedule}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Schedule" - } - ]; - - // Optional. Whether to backfill missed runs when the schedule is resumed from - // PAUSED state. If set to true, all missed runs will be scheduled. New runs - // will be scheduled after the backfill is complete. This will also update - // [Schedule.catch_up][google.cloud.aiplatform.v1beta1.Schedule.catch_up] - // field. Default to false. - bool catch_up = 2 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto deleted file mode 100644 index 18950e8441e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/schemapb;schemapb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto deleted file mode 100644 index b5ae22ffc6e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/schemapb;schemapb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto deleted file mode 100644 index 8911cd607f8..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/schemapb;schemapb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto deleted file mode 100644 index 730280aee0b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/schemapb;schemapb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto deleted file mode 100644 index f196fe3524e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/schemapb;schemapb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto deleted file mode 100644 index 3a9cd5b3b2c..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto deleted file mode 100644 index 1edc6cc8e7f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto deleted file mode 100644 index 5056881c1e1..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto deleted file mode 100644 index bf773184d20..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto deleted file mode 100644 index 764eeea7e4d..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto deleted file mode 100644 index 73bf0893967..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto deleted file mode 100644 index 570f0394e09..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto deleted file mode 100644 index 52eee2a8136..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto deleted file mode 100644 index b347e992535..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/instance/instancepb;instancepb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto deleted file mode 100644 index 8082195114a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/params/paramspb;paramspb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto deleted file mode 100644 index 637d1569e68..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/params/paramspb;paramspb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto deleted file mode 100644 index 47d8ddcf25a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/params/paramspb;paramspb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto deleted file mode 100644 index fad0f06ef8e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/params/paramspb;paramspb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto deleted file mode 100644 index 57dc95f678b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/params/paramspb;paramspb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto deleted file mode 100644 index 8232278bb06..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/params/paramspb;paramspb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto deleted file mode 100644 index 1bd03d4de2e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto deleted file mode 100644 index 3521f795569..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto deleted file mode 100644 index edd3a740b47..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto deleted file mode 100644 index ffdb995768e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto deleted file mode 100644 index 65fd7cfcca2..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto deleted file mode 100644 index 1b42997ee8c..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto deleted file mode 100644 index 23c1b68a90d..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto deleted file mode 100644 index c9f641e6595..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto deleted file mode 100644 index 30bfd9963c1..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto deleted file mode 100644 index faac51147e7..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto deleted file mode 100644 index 6af9eea3d71..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/predict/prediction/predictionpb;predictionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto deleted file mode 100644 index 1a2c9ede4f2..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto deleted file mode 100644 index b80309b501c..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto deleted file mode 100644 index b4385fbc0e5..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto deleted file mode 100644 index 5930e169902..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto deleted file mode 100644 index 61c16c434c8..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto deleted file mode 100644 index f92b0b467e0..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto deleted file mode 100644 index 75563ff2a64..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto deleted file mode 100644 index 130a2f0ebeb..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto deleted file mode 100644 index 750ddfa4b92..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto deleted file mode 100644 index e69c1ab0301..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto deleted file mode 100644 index 72132b3e3a4..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto deleted file mode 100644 index 0fec2c8554e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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 = "cloud.google.com/go/aiplatform/apiv1beta1/schema/trainingjob/definition/definitionpb;definitionpb"; -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.search_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.mutate_deployed_model.jsinclude:samples/generated/v1/endpoint_service.mutate_deployed_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.write_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.delete_feature_values.jsinclude:samples/generated/v1/featurestore_service.delete_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_nas_job.jsinclude:samples/generated/v1/job_service.get_nas_job.jsinclude:samples/generated/v1/job_service.cancel_nas_job.jsinclude:samples/generated/v1/job_service.get_nas_trial_detail.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_nas_job.jsinclude:samples/generated/v1/job_service.delete_nas_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_nas_jobs.jsinclude:samples/generated/v1/job_service.list_nas_trial_details.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.remove_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.batch_import_evaluated_annotations.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.copy_model.jsinclude:samples/generated/v1/model_service.copy_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.read_tensorboard_usage.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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/service_networking.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/service_networking.proto deleted file mode 100644 index 93afe75522e..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/service_networking.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -option java_multiple_files = true; -option java_outer_classname = "ServiceNetworkingProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Represents configuration for private service connect. -message PrivateServiceConnectConfig { - // Required. If true, expose the IndexEndpoint via private service connect. - bool enable_private_service_connect = 1 - [(google.api.field_behavior) = REQUIRED]; - - // A list of Projects from which the forwarding rule will target the service - // attachment. - repeated string project_allowlist = 2; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto deleted file mode 100644 index c579bafb768..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto deleted file mode 100644 index db722c0e487..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/study.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/study.proto deleted file mode 100644 index 46a85557113..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/study.proto +++ /dev/null @@ -1,663 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 { - // Used in safe optimization to specify threshold levels and risk tolerance. - message SafetyMetricConfig { - // Safety threshold (boundary value between safe and unsafe). NOTE that if - // you leave SafetyMetricConfig unset, a default value of 0 will be used. - double safety_threshold = 1; - - // Desired minimum fraction of safe trials (over total number of trials) - // that should be targeted by the algorithm at any time during the - // study (best effort). This should be between 0.0 and 1.0 and a value of - // 0.0 means that there is no minimum and an algorithm proceeds without - // targeting any specific fraction. A value of 1.0 means that the - // algorithm attempts to only Suggest safe Trials. - optional double desired_min_safe_trials_fraction = 2; - } - - // 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]; - - // Used for safe search. In the case, the metric will be a safety - // metric. You must provide a separate metric for objective metric. - optional SafetyMetricConfig safety_config = 3; - } - - // 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; - - // ConvexAutomatedStoppingSpec by default only updates the trials that needs - // to be early stopped using a newly trained auto-regressive model. When - // this flag is set to True, all stopped trials from the beginning are - // potentially updated in terms of their `final_measurement`. Also, note - // that the training logic of autoregressive models is different in this - // case. Enabling this option has shown better results and this may be the - // default option in the future. - optional bool update_all_stopped_trials = 6; - } - - // 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; - } - - // This contains flag for manually disabling transfer learning for a study. - // The names of prior studies being used for transfer learning (if any) - // are also listed here. - message TransferLearningConfig { - // Flag to to manually prevent vizier from using transfer learning on a - // new study. Otherwise, vizier will automatically determine whether or not - // to use transfer learning. - bool disable_transfer_learning = 1; - - // Output only. Names of previously completed studies - repeated string prior_study_names = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // 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; - - // The configuration info/options for transfer learning. Currently supported - // for Vertex AI Vizier service, not HyperParameterTuningJob - TransferLearningConfig transfer_learning_config = 10; -} - -// 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto deleted file mode 100644 index 83738c6fa3b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 Google Cloud 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; - - // Used to indicate if the TensorBoard instance is the default one. - // Each project & region can have at most one default TensorBoard instance. - // Creation of a default TensorBoard instance and updating an existing - // TensorBoard instance to be default will mark all other TensorBoard - // instances (if any) as non default. - bool is_default = 12; -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto deleted file mode 100644 index 86048f41639..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto deleted file mode 100644 index c29f2f17b6a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 cannot be 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. The 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 = 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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto deleted file mode 100644 index 682c20891bb..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto deleted file mode 100644 index df9799cc9c5..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto +++ /dev/null @@ -1,1132 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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"; - } - - // Returns a list of monthly active users for a given TensorBoard instance. - rpc ReadTensorboardUsage(ReadTensorboardUsageRequest) - returns (ReadTensorboardUsageResponse) { - option (google.api.http) = { - get: "/v1beta1/{tensorboard=projects/*/locations/*/tensorboards/*}:readUsage" - }; - option (google.api.method_signature) = "tensorboard"; - } - - // 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 is returned. - // Otherwise, the number limit of data points is 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 is returned. Otherwise, 1000 - // data points is 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 is 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 is 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.GetTensorboardUsage][]. -message ReadTensorboardUsageRequest { - // Required. The name of the Tensorboard resource. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - string tensorboard = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Tensorboard" - } - ]; -} - -// Response message for -// [TensorboardService.ReadTensorboardUsage][google.cloud.aiplatform.v1beta1.TensorboardService.ReadTensorboardUsage]. -message ReadTensorboardUsageResponse { - // Per user usage data. - message PerUserUsageData { - // User's username - string username = 1; - - // Number of times the user has read data within the Tensorboard. - int64 view_count = 2; - } - - // Per month usage data - message PerMonthUsageData { - // Usage data for each user in the given month. - repeated PerUserUsageData user_usage_data = 1; - } - - // Maps year-month (YYYYMM) string to per month usage data. - map monthly_usage_data = 1; -} - -// 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 are - // returned. The maximum value is 100; values above 100 are 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 is overwritten if it's in the mask. If the - // user does not provide a mask then all fields are 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 becomes 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 are returned. The maximum value is 1000; values - // above 1000 are 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 is overwritten if it's in the mask. If the - // user does not provide a mask then all fields are 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 becomes 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 are - // returned. The maximum value is 1000; values above 1000 are 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 is overwritten if it's in the mask. If the - // user does not provide a mask then all fields are 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 becomes 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 are returned. The maximum value is 1000; values - // above 1000 are 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 is overwritten if it's in the mask. If the - // user does not provide a mask then all fields are 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 is 1000. Values must be between 1 and 10000. - // Values above 10000 are coerced to 10000. - int32 page_size = 3; - - // A page token, received from a previous - // [ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData] - // call. Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData] - // 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 is 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 - // [page_token][google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest.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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto deleted file mode 100644 index 9985d67eebd..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto b/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto deleted file mode 100644 index b631633c65c..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto +++ /dev/null @@ -1,450 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; -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 {@link google.cloud.aiplatform.v1beta1.Dataset | 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 {@link google.cloud.aiplatform.v1beta1.AnnotationSpec | 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 {@link google.cloud.aiplatform.v1beta1.Dataset | 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 {@link google.cloud.aiplatform.v1beta1.Dataset | 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 - * {@link google.cloud.aiplatform.v1beta1.Dataset | 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 {@link google.cloud.aiplatform.v1beta1.DataItem | 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 {@link google.cloud.aiplatform.v1beta1.DataItem | 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 - * {@link google.cloud.aiplatform.v1beta1.DataItem | 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; - } - /** - * Searches DataItems in a Dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.orderByDataItem - * A comma-separated list of data item fields to order by, sorted in - * ascending order. Use "desc" after a field name for descending. - * @param {google.cloud.aiplatform.v1beta1.SearchDataItemsRequest.OrderByAnnotation} request.orderByAnnotation - * Expression that allows ranking results based on annotation's property. - * @param {string} request.dataset - * Required. The resource name of the Dataset from which to search DataItems. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {string} request.savedQuery - * The resource name of a SavedQuery(annotation set in UI). - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` - * All of the search will be done in the context of this SavedQuery. - * @param {string} request.dataLabelingJob - * The resource name of a DataLabelingJob. - * Format: - * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - * If this field is set, all of the search will be done in the context of - * this DataLabelingJob. - * @param {string} request.dataItemFilter - * An expression for filtering the DataItem that will be returned. - * - * * `data_item_id` - for = or !=. - * * `labeled` - for = or !=. - * * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that - * have at least one annotation with annotation_spec_id = - * `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. - * - * For example: - * - * * `data_item=1` - * * `has_annotation(5)` - * @param {string} request.annotationsFilter - * An expression for filtering the Annotations that will be returned per - * DataItem. - * * `annotation_spec_id` - for = or !=. - * @param {string[]} request.annotationFilters - * An expression that specifies what Annotations will be returned per - * DataItem. Annotations satisfied either of the conditions will be returned. - * * `annotation_spec_id` - for = or !=. - * Must specify `saved_query_id=` - saved query id that annotations should - * belong to. - * @param {google.protobuf.FieldMask} request.fieldMask - * Mask specifying which fields of - * {@link google.cloud.aiplatform.v1beta1.DataItemView|DataItemView} to read. - * @param {number} request.annotationsLimit - * If set, only up to this many of Annotations will be returned per - * DataItemView. The maximum value is 1000. If not set, the maximum value will - * be used. - * @param {number} request.pageSize - * Requested page size. Server may return fewer results than requested. - * Default and maximum page size is 100. - * @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 {string} request.pageToken - * A token identifying a page of results for the server to return - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.SearchDataItemsResponse.next_page_token|SearchDataItemsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1beta1.DatasetService.SearchDataItems|DatasetService.SearchDataItems} - * call. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.cloud.aiplatform.v1beta1.DataItemView | DataItemView}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `searchDataItemsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchDataItems( - request?: protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDataItemView[], - protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest|null, - protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsResponse - ]>; - searchDataItems( - request: protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, - protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDataItemView>): void; - searchDataItems( - request: protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, - protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDataItemView>): void; - searchDataItems( - request?: protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, - protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDataItemView>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, - protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDataItemView>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDataItemView[], - protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest|null, - protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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': request.dataset ?? '', - }); - this.initialize(); - return this.innerApiCalls.searchDataItems(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.orderByDataItem - * A comma-separated list of data item fields to order by, sorted in - * ascending order. Use "desc" after a field name for descending. - * @param {google.cloud.aiplatform.v1beta1.SearchDataItemsRequest.OrderByAnnotation} request.orderByAnnotation - * Expression that allows ranking results based on annotation's property. - * @param {string} request.dataset - * Required. The resource name of the Dataset from which to search DataItems. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {string} request.savedQuery - * The resource name of a SavedQuery(annotation set in UI). - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` - * All of the search will be done in the context of this SavedQuery. - * @param {string} request.dataLabelingJob - * The resource name of a DataLabelingJob. - * Format: - * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - * If this field is set, all of the search will be done in the context of - * this DataLabelingJob. - * @param {string} request.dataItemFilter - * An expression for filtering the DataItem that will be returned. - * - * * `data_item_id` - for = or !=. - * * `labeled` - for = or !=. - * * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that - * have at least one annotation with annotation_spec_id = - * `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. - * - * For example: - * - * * `data_item=1` - * * `has_annotation(5)` - * @param {string} request.annotationsFilter - * An expression for filtering the Annotations that will be returned per - * DataItem. - * * `annotation_spec_id` - for = or !=. - * @param {string[]} request.annotationFilters - * An expression that specifies what Annotations will be returned per - * DataItem. Annotations satisfied either of the conditions will be returned. - * * `annotation_spec_id` - for = or !=. - * Must specify `saved_query_id=` - saved query id that annotations should - * belong to. - * @param {google.protobuf.FieldMask} request.fieldMask - * Mask specifying which fields of - * {@link google.cloud.aiplatform.v1beta1.DataItemView|DataItemView} to read. - * @param {number} request.annotationsLimit - * If set, only up to this many of Annotations will be returned per - * DataItemView. The maximum value is 1000. If not set, the maximum value will - * be used. - * @param {number} request.pageSize - * Requested page size. Server may return fewer results than requested. - * Default and maximum page size is 100. - * @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 {string} request.pageToken - * A token identifying a page of results for the server to return - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.SearchDataItemsResponse.next_page_token|SearchDataItemsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1beta1.DatasetService.SearchDataItems|DatasetService.SearchDataItems} - * call. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.cloud.aiplatform.v1beta1.DataItemView | DataItemView} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `searchDataItemsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchDataItemsStream( - request?: protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, - 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({ - 'dataset': request.dataset ?? '', - }); - const defaultCallSettings = this._defaults['searchDataItems']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchDataItems.createStream( - this.innerApiCalls.searchDataItems as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `searchDataItems`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.orderByDataItem - * A comma-separated list of data item fields to order by, sorted in - * ascending order. Use "desc" after a field name for descending. - * @param {google.cloud.aiplatform.v1beta1.SearchDataItemsRequest.OrderByAnnotation} request.orderByAnnotation - * Expression that allows ranking results based on annotation's property. - * @param {string} request.dataset - * Required. The resource name of the Dataset from which to search DataItems. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {string} request.savedQuery - * The resource name of a SavedQuery(annotation set in UI). - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}` - * All of the search will be done in the context of this SavedQuery. - * @param {string} request.dataLabelingJob - * The resource name of a DataLabelingJob. - * Format: - * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - * If this field is set, all of the search will be done in the context of - * this DataLabelingJob. - * @param {string} request.dataItemFilter - * An expression for filtering the DataItem that will be returned. - * - * * `data_item_id` - for = or !=. - * * `labeled` - for = or !=. - * * `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that - * have at least one annotation with annotation_spec_id = - * `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob. - * - * For example: - * - * * `data_item=1` - * * `has_annotation(5)` - * @param {string} request.annotationsFilter - * An expression for filtering the Annotations that will be returned per - * DataItem. - * * `annotation_spec_id` - for = or !=. - * @param {string[]} request.annotationFilters - * An expression that specifies what Annotations will be returned per - * DataItem. Annotations satisfied either of the conditions will be returned. - * * `annotation_spec_id` - for = or !=. - * Must specify `saved_query_id=` - saved query id that annotations should - * belong to. - * @param {google.protobuf.FieldMask} request.fieldMask - * Mask specifying which fields of - * {@link google.cloud.aiplatform.v1beta1.DataItemView|DataItemView} to read. - * @param {number} request.annotationsLimit - * If set, only up to this many of Annotations will be returned per - * DataItemView. The maximum value is 1000. If not set, the maximum value will - * be used. - * @param {number} request.pageSize - * Requested page size. Server may return fewer results than requested. - * Default and maximum page size is 100. - * @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 {string} request.pageToken - * A token identifying a page of results for the server to return - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.SearchDataItemsResponse.next_page_token|SearchDataItemsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1beta1.DatasetService.SearchDataItems|DatasetService.SearchDataItems} - * call. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.aiplatform.v1beta1.DataItemView | DataItemView}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see 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_SearchDataItems_async - */ - searchDataItemsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.ISearchDataItemsRequest, - 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({ - 'dataset': request.dataset ?? '', - }); - const defaultCallSettings = this._defaults['searchDataItems']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchDataItems.asyncIterate( - this.innerApiCalls['searchDataItems'] 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 {@link google.cloud.aiplatform.v1beta1.SavedQuery | 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 {@link google.cloud.aiplatform.v1beta1.SavedQuery | 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 - * {@link google.cloud.aiplatform.v1beta1.SavedQuery | 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 {@link google.cloud.aiplatform.v1beta1.Annotation | 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 {@link google.cloud.aiplatform.v1beta1.Annotation | 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 - * {@link google.cloud.aiplatform.v1beta1.Annotation | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_client_config.json deleted file mode 100644 index 697d04ac3f8..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_client_config.json +++ /dev/null @@ -1,84 +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" - }, - "SearchDataItems": { - "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/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/dataset_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client.ts deleted file mode 100644 index 29c702896ca..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client.ts +++ /dev/null @@ -1,3788 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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 {@link google.cloud.aiplatform.v1beta1.DeploymentResourcePool | 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 {@link google.cloud.aiplatform.v1beta1.DeploymentResourcePool | 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 {@link google.cloud.aiplatform.v1beta1.DeploymentResourcePool | 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 - * {@link google.cloud.aiplatform.v1beta1.DeploymentResourcePool | 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 {@link google.cloud.aiplatform.v1beta1.DeployedModel | 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 {@link google.cloud.aiplatform.v1beta1.DeployedModel | 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 - * {@link google.cloud.aiplatform.v1beta1.DeployedModel | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_client_config.json deleted file mode 100644 index 060fe05281c..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/deployment_resource_pool_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client.ts deleted file mode 100644 index db12134ab2c..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client.ts +++ /dev/null @@ -1,4052 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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; - const mutateDeployedModelResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse') as gax.protobuf.Type; - const mutateDeployedModelMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata') 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)), - mutateDeployedModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - mutateDeployedModelResponse.decode.bind(mutateDeployedModelResponse), - mutateDeployedModelMetadata.decode.bind(mutateDeployedModelMetadata)) - }; - - // 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', 'mutateDeployedModel']; - 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 {@link google.cloud.aiplatform.v1beta1.Endpoint | 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 {@link google.cloud.aiplatform.v1beta1.Endpoint | 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. - * - * If the first character is a letter, this value may be up to 63 characters, - * and valid characters are `[a-z0-9-]`. The last character must be a letter - * or number. - * - * If the first character is a number, this value may be up to 9 characters, - * and valid characters are `[0-9]` with no leading zeros. - * - * 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; - } -/** - * Updates an existing deployed model. Updatable fields include - * `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, - * `disable_container_logging` (v1 only), and `enable_container_logging` - * (v1beta1 only). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.endpoint - * Required. The name of the Endpoint resource into which to mutate a - * DeployedModel. Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param {google.cloud.aiplatform.v1beta1.DeployedModel} request.deployedModel - * Required. The DeployedModel to be mutated within the Endpoint. Only the - * following fields can be mutated: - * - * * `min_replica_count` in either - * {@link google.cloud.aiplatform.v1beta1.DedicatedResources|DedicatedResources} or - * {@link google.cloud.aiplatform.v1beta1.AutomaticResources|AutomaticResources} - * * `max_replica_count` in either - * {@link google.cloud.aiplatform.v1beta1.DedicatedResources|DedicatedResources} or - * {@link google.cloud.aiplatform.v1beta1.AutomaticResources|AutomaticResources} - * * {@link google.cloud.aiplatform.v1beta1.DedicatedResources.autoscaling_metric_specs|autoscaling_metric_specs} - * * `disable_container_logging` (v1 only) - * * `enable_container_logging` (v1beta1 only) - * @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 - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://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_MutateDeployedModel_async - */ - mutateDeployedModel( - request?: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - mutateDeployedModel( - request: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - mutateDeployedModel( - request: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - mutateDeployedModel( - request?: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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.mutateDeployedModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `mutateDeployedModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://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_MutateDeployedModel_async - */ - async checkMutateDeployedModelProgress(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.mutateDeployedModel, 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 [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"` - * @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 {@link google.cloud.aiplatform.v1beta1.Endpoint | 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 [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"` - * @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 {@link google.cloud.aiplatform.v1beta1.Endpoint | 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 [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"` - * @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 - * {@link google.cloud.aiplatform.v1beta1.Endpoint | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client_config.json deleted file mode 100644 index 25b4f7170d1..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_client_config.json +++ /dev/null @@ -1,65 +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" - }, - "MutateDeployedModel": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/endpoint_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts deleted file mode 100644 index 43772b8f8e1..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts +++ /dev/null @@ -1,3061 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, 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}; - 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - 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') - }; - - // 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 {@link google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse | 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 {@link google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse | 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 {@link google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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); - } - - // -------------------- - // -- 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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_client_config.json deleted file mode 100644 index bbe56dc0064..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client.ts deleted file mode 100644 index 2ec04da1b0f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client.ts +++ /dev/null @@ -1,6213 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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; - const deleteFeatureValuesResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteFeatureValuesResponse') as gax.protobuf.Type; - const deleteFeatureValuesMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteFeatureValuesOperationMetadata') 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)), - deleteFeatureValues: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteFeatureValuesResponse.decode.bind(deleteFeatureValuesResponse), - deleteFeatureValuesMetadata.decode.bind(deleteFeatureValuesMetadata)) - }; - - // 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', 'deleteFeatureValues', '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 {@link google.cloud.aiplatform.v1beta1.Featurestore | 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 {@link google.cloud.aiplatform.v1beta1.EntityType | 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` - * * `offline_storage_ttl_days` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.aiplatform.v1beta1.EntityType | 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 {@link google.cloud.aiplatform.v1beta1.Feature | 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 {@link google.cloud.aiplatform.v1beta1.Feature | 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` - * * `online_storage_ttl_days` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://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 128 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. - * @param {google.protobuf.Timestamp} [request.startTime] - * Optional. 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://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; - } -/** - * Delete Feature values from Featurestore. - * - * The progress of the deletion is tracked by the returned operation. The - * deleted feature values are guaranteed to be invisible to subsequent read - * operations after the operation is marked as successfully done. - * - * If a delete feature values operation fails, the feature values - * returned from reads and exports may be inconsistent. If consistency is - * required, the caller must retry the same delete request again and wait till - * the new operation returned is marked as successfully done. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.DeleteFeatureValuesRequest.SelectEntity} request.selectEntity - * Select feature values to be deleted by specifying entities. - * @param {google.cloud.aiplatform.v1beta1.DeleteFeatureValuesRequest.SelectTimeRangeAndFeature} request.selectTimeRangeAndFeature - * Select feature values to be deleted by specifying time range and - * features. - * @param {string} request.entityType - * Required. The resource name of the EntityType grouping the Features for - * which values are being deleted from. Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{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_DeleteFeatureValues_async - */ - deleteFeatureValues( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteFeatureValuesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteFeatureValues( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteFeatureValuesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteFeatureValues( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteFeatureValuesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteFeatureValues( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteFeatureValuesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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.deleteFeatureValues(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteFeatureValues()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://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_DeleteFeatureValues_async - */ - async checkDeleteFeatureValuesProgress(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.deleteFeatureValues, 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 {@link google.cloud.aiplatform.v1beta1.Featurestore | 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 {@link google.cloud.aiplatform.v1beta1.Featurestore | 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 - * {@link google.cloud.aiplatform.v1beta1.Featurestore | 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 {@link google.cloud.aiplatform.v1beta1.EntityType | 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 {@link google.cloud.aiplatform.v1beta1.EntityType | 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 - * {@link google.cloud.aiplatform.v1beta1.EntityType | 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 {@link google.cloud.aiplatform.v1beta1.Feature | 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 {@link google.cloud.aiplatform.v1beta1.Feature | 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 - * {@link google.cloud.aiplatform.v1beta1.Feature | 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 {@link google.cloud.aiplatform.v1beta1.Feature | 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 {@link google.cloud.aiplatform.v1beta1.Feature | 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 - * {@link google.cloud.aiplatform.v1beta1.Feature | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client_config.json deleted file mode 100644 index 210e871c485..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_client_config.json +++ /dev/null @@ -1,129 +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" - }, - "DeleteFeatureValues": { - "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/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/featurestore_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/gapic_metadata.json deleted file mode 100644 index a2478c9f558..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/gapic_metadata.json +++ /dev/null @@ -1,2633 +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" - ] - }, - "SearchDataItems": { - "methods": [ - "searchDataItems", - "searchDataItemsStream", - "searchDataItemsAsync" - ] - }, - "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" - ] - }, - "SearchDataItems": { - "methods": [ - "searchDataItems", - "searchDataItemsStream", - "searchDataItemsAsync" - ] - }, - "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" - ] - }, - "MutateDeployedModel": { - "methods": [ - "mutateDeployedModel" - ] - }, - "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" - ] - }, - "MutateDeployedModel": { - "methods": [ - "mutateDeployedModel" - ] - }, - "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" - ] - }, - "DeleteFeatureValues": { - "methods": [ - "deleteFeatureValues" - ] - }, - "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" - ] - }, - "DeleteFeatureValues": { - "methods": [ - "deleteFeatureValues" - ] - }, - "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" - ] - }, - "CreateNasJob": { - "methods": [ - "createNasJob" - ] - }, - "GetNasJob": { - "methods": [ - "getNasJob" - ] - }, - "CancelNasJob": { - "methods": [ - "cancelNasJob" - ] - }, - "GetNasTrialDetail": { - "methods": [ - "getNasTrialDetail" - ] - }, - "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" - ] - }, - "DeleteNasJob": { - "methods": [ - "deleteNasJob" - ] - }, - "DeleteBatchPredictionJob": { - "methods": [ - "deleteBatchPredictionJob" - ] - }, - "UpdateModelDeploymentMonitoringJob": { - "methods": [ - "updateModelDeploymentMonitoringJob" - ] - }, - "DeleteModelDeploymentMonitoringJob": { - "methods": [ - "deleteModelDeploymentMonitoringJob" - ] - }, - "ListCustomJobs": { - "methods": [ - "listCustomJobs", - "listCustomJobsStream", - "listCustomJobsAsync" - ] - }, - "ListDataLabelingJobs": { - "methods": [ - "listDataLabelingJobs", - "listDataLabelingJobsStream", - "listDataLabelingJobsAsync" - ] - }, - "ListHyperparameterTuningJobs": { - "methods": [ - "listHyperparameterTuningJobs", - "listHyperparameterTuningJobsStream", - "listHyperparameterTuningJobsAsync" - ] - }, - "ListNasJobs": { - "methods": [ - "listNasJobs", - "listNasJobsStream", - "listNasJobsAsync" - ] - }, - "ListNasTrialDetails": { - "methods": [ - "listNasTrialDetails", - "listNasTrialDetailsStream", - "listNasTrialDetailsAsync" - ] - }, - "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" - ] - }, - "CreateNasJob": { - "methods": [ - "createNasJob" - ] - }, - "GetNasJob": { - "methods": [ - "getNasJob" - ] - }, - "CancelNasJob": { - "methods": [ - "cancelNasJob" - ] - }, - "GetNasTrialDetail": { - "methods": [ - "getNasTrialDetail" - ] - }, - "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" - ] - }, - "DeleteNasJob": { - "methods": [ - "deleteNasJob" - ] - }, - "DeleteBatchPredictionJob": { - "methods": [ - "deleteBatchPredictionJob" - ] - }, - "UpdateModelDeploymentMonitoringJob": { - "methods": [ - "updateModelDeploymentMonitoringJob" - ] - }, - "DeleteModelDeploymentMonitoringJob": { - "methods": [ - "deleteModelDeploymentMonitoringJob" - ] - }, - "ListCustomJobs": { - "methods": [ - "listCustomJobs", - "listCustomJobsStream", - "listCustomJobsAsync" - ] - }, - "ListDataLabelingJobs": { - "methods": [ - "listDataLabelingJobs", - "listDataLabelingJobsStream", - "listDataLabelingJobsAsync" - ] - }, - "ListHyperparameterTuningJobs": { - "methods": [ - "listHyperparameterTuningJobs", - "listHyperparameterTuningJobsStream", - "listHyperparameterTuningJobsAsync" - ] - }, - "ListNasJobs": { - "methods": [ - "listNasJobs", - "listNasJobsStream", - "listNasJobsAsync" - ] - }, - "ListNasTrialDetails": { - "methods": [ - "listNasTrialDetails", - "listNasTrialDetailsStream", - "listNasTrialDetailsAsync" - ] - }, - "ListBatchPredictionJobs": { - "methods": [ - "listBatchPredictionJobs", - "listBatchPredictionJobsStream", - "listBatchPredictionJobsAsync" - ] - }, - "SearchModelDeploymentMonitoringStatsAnomalies": { - "methods": [ - "searchModelDeploymentMonitoringStatsAnomalies", - "searchModelDeploymentMonitoringStatsAnomaliesStream", - "searchModelDeploymentMonitoringStatsAnomaliesAsync" - ] - }, - "ListModelDeploymentMonitoringJobs": { - "methods": [ - "listModelDeploymentMonitoringJobs", - "listModelDeploymentMonitoringJobsStream", - "listModelDeploymentMonitoringJobsAsync" - ] - } - } - } - } - }, - "MatchService": { - "clients": { - "grpc": { - "libraryClient": "MatchServiceClient", - "rpcs": { - "FindNeighbors": { - "methods": [ - "findNeighbors" - ] - }, - "ReadIndexDatapoints": { - "methods": [ - "readIndexDatapoints" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "MatchServiceClient", - "rpcs": { - "FindNeighbors": { - "methods": [ - "findNeighbors" - ] - }, - "ReadIndexDatapoints": { - "methods": [ - "readIndexDatapoints" - ] - } - } - } - } - }, - "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" - ] - }, - "RemoveContextChildren": { - "methods": [ - "removeContextChildren" - ] - }, - "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" - ] - }, - "RemoveContextChildren": { - "methods": [ - "removeContextChildren" - ] - }, - "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" - ] - }, - "BatchImportEvaluatedAnnotations": { - "methods": [ - "batchImportEvaluatedAnnotations" - ] - }, - "GetModelEvaluation": { - "methods": [ - "getModelEvaluation" - ] - }, - "GetModelEvaluationSlice": { - "methods": [ - "getModelEvaluationSlice" - ] - }, - "UploadModel": { - "methods": [ - "uploadModel" - ] - }, - "UpdateExplanationDataset": { - "methods": [ - "updateExplanationDataset" - ] - }, - "DeleteModel": { - "methods": [ - "deleteModel" - ] - }, - "DeleteModelVersion": { - "methods": [ - "deleteModelVersion" - ] - }, - "ExportModel": { - "methods": [ - "exportModel" - ] - }, - "CopyModel": { - "methods": [ - "copyModel" - ] - }, - "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" - ] - }, - "BatchImportEvaluatedAnnotations": { - "methods": [ - "batchImportEvaluatedAnnotations" - ] - }, - "GetModelEvaluation": { - "methods": [ - "getModelEvaluation" - ] - }, - "GetModelEvaluationSlice": { - "methods": [ - "getModelEvaluationSlice" - ] - }, - "UploadModel": { - "methods": [ - "uploadModel" - ] - }, - "UpdateExplanationDataset": { - "methods": [ - "updateExplanationDataset" - ] - }, - "DeleteModel": { - "methods": [ - "deleteModel" - ] - }, - "DeleteModelVersion": { - "methods": [ - "deleteModelVersion" - ] - }, - "ExportModel": { - "methods": [ - "exportModel" - ] - }, - "CopyModel": { - "methods": [ - "copyModel" - ] - }, - "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" - ] - } - } - } - } - }, - "ScheduleService": { - "clients": { - "grpc": { - "libraryClient": "ScheduleServiceClient", - "rpcs": { - "CreateSchedule": { - "methods": [ - "createSchedule" - ] - }, - "GetSchedule": { - "methods": [ - "getSchedule" - ] - }, - "PauseSchedule": { - "methods": [ - "pauseSchedule" - ] - }, - "ResumeSchedule": { - "methods": [ - "resumeSchedule" - ] - }, - "DeleteSchedule": { - "methods": [ - "deleteSchedule" - ] - }, - "ListSchedules": { - "methods": [ - "listSchedules", - "listSchedulesStream", - "listSchedulesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ScheduleServiceClient", - "rpcs": { - "CreateSchedule": { - "methods": [ - "createSchedule" - ] - }, - "GetSchedule": { - "methods": [ - "getSchedule" - ] - }, - "PauseSchedule": { - "methods": [ - "pauseSchedule" - ] - }, - "ResumeSchedule": { - "methods": [ - "resumeSchedule" - ] - }, - "DeleteSchedule": { - "methods": [ - "deleteSchedule" - ] - }, - "ListSchedules": { - "methods": [ - "listSchedules", - "listSchedulesStream", - "listSchedulesAsync" - ] - } - } - } - } - }, - "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" - ] - }, - "ReadTensorboardUsage": { - "methods": [ - "readTensorboardUsage" - ] - }, - "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" - ] - }, - "ReadTensorboardUsage": { - "methods": [ - "readTensorboardUsage" - ] - }, - "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/google-cloud-aiplatform/v1beta1/src/v1beta1/index.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index.ts deleted file mode 100644 index b85f2840923..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 {MatchServiceClient} from './match_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 {ScheduleServiceClient} from './schedule_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/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client.ts deleted file mode 100644 index df50376b489..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client.ts +++ /dev/null @@ -1,4005 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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 {@link google.cloud.aiplatform.v1beta1.IndexEndpoint | 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 {@link google.cloud.aiplatform.v1beta1.IndexEndpoint | 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 {@link google.cloud.aiplatform.v1beta1.IndexEndpoint | 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 {@link google.cloud.aiplatform.v1beta1.IndexEndpoint | 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 - * {@link google.cloud.aiplatform.v1beta1.IndexEndpoint | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_client_config.json deleted file mode 100644 index a2abf1a1867..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client.ts deleted file mode 100644 index 88c3c8a0c28..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client.ts +++ /dev/null @@ -1,3821 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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 {@link google.cloud.aiplatform.v1beta1.Index | 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 {@link google.cloud.aiplatform.v1beta1.UpsertDatapointsResponse | 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 {@link google.cloud.aiplatform.v1beta1.RemoveDatapointsResponse | 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 {@link google.cloud.aiplatform.v1beta1.Index | 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 {@link google.cloud.aiplatform.v1beta1.Index | 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 - * {@link google.cloud.aiplatform.v1beta1.Index | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_client_config.json deleted file mode 100644 index 18cb24612b1..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/index_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client.ts deleted file mode 100644 index 6bc5468f08a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client.ts +++ /dev/null @@ -1,7342 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - 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'), - listNasJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'nasJobs'), - listNasTrialDetails: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'nasTrialDetails'), - 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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 deleteNasJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteNasJobMetadata = 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)), - deleteNasJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteNasJobResponse.decode.bind(deleteNasJobResponse), - deleteNasJobMetadata.decode.bind(deleteNasJobMetadata)), - 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', 'createNasJob', 'getNasJob', 'listNasJobs', 'deleteNasJob', 'cancelNasJob', 'getNasTrialDetail', 'listNasTrialDetails', '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', - '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 -- - // ------------------- -/** - * 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 {@link google.cloud.aiplatform.v1beta1.CustomJob | 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 {@link google.cloud.aiplatform.v1beta1.CustomJob | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1beta1.DataLabelingJob | 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 {@link google.cloud.aiplatform.v1beta1.DataLabelingJob | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob | 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 {@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob | 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 {@link google.protobuf.Empty | 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 NasJob - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the NasJob in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1beta1.NasJob} request.nasJob - * Required. The NasJob 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 {@link google.cloud.aiplatform.v1beta1.NasJob | NasJob}. - * Please see the - * [documentation](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_CreateNasJob_async - */ - createNasJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.INasJob, - protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest|undefined, {}|undefined - ]>; - createNasJob( - request: protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.INasJob, - protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest|null|undefined, - {}|null|undefined>): void; - createNasJob( - request: protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.INasJob, - protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest|null|undefined, - {}|null|undefined>): void; - createNasJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.INasJob, - protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.INasJob, - protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.INasJob, - protos.google.cloud.aiplatform.v1beta1.ICreateNasJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createNasJob(request, options, callback); - } -/** - * Gets a NasJob - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the NasJob resource. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_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 {@link google.cloud.aiplatform.v1beta1.NasJob | NasJob}. - * Please see the - * [documentation](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_GetNasJob_async - */ - getNasJob( - request?: protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.INasJob, - protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest|undefined, {}|undefined - ]>; - getNasJob( - request: protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.INasJob, - protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest|null|undefined, - {}|null|undefined>): void; - getNasJob( - request: protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.INasJob, - protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest|null|undefined, - {}|null|undefined>): void; - getNasJob( - request?: protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.INasJob, - protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.INasJob, - protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.INasJob, - protos.google.cloud.aiplatform.v1beta1.IGetNasJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getNasJob(request, options, callback); - } -/** - * Cancels a NasJob. - * Starts asynchronous cancellation on the NasJob. The server - * makes a best effort to cancel the job, but success is not - * guaranteed. Clients can use - * {@link google.cloud.aiplatform.v1beta1.JobService.GetNasJob|JobService.GetNasJob} - * or other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On successful cancellation, - * the NasJob is not deleted; instead it becomes a job with - * a {@link google.cloud.aiplatform.v1beta1.NasJob.error|NasJob.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.NasJob.state|NasJob.state} is set to - * `CANCELLED`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the NasJob to cancel. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_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 {@link google.protobuf.Empty | 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_CancelNasJob_async - */ - cancelNasJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest|undefined, {}|undefined - ]>; - cancelNasJob( - request: protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest|null|undefined, - {}|null|undefined>): void; - cancelNasJob( - request: protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest|null|undefined, - {}|null|undefined>): void; - cancelNasJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelNasJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.cancelNasJob(request, options, callback); - } -/** - * Gets a NasTrialDetail. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the NasTrialDetail resource. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.aiplatform.v1beta1.NasTrialDetail | NasTrialDetail}. - * Please see the - * [documentation](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_GetNasTrialDetail_async - */ - getNasTrialDetail( - request?: protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.INasTrialDetail, - protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest|undefined, {}|undefined - ]>; - getNasTrialDetail( - request: protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.INasTrialDetail, - protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest|null|undefined, - {}|null|undefined>): void; - getNasTrialDetail( - request: protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.INasTrialDetail, - protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest|null|undefined, - {}|null|undefined>): void; - getNasTrialDetail( - request?: protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.INasTrialDetail, - protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.INasTrialDetail, - protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.INasTrialDetail, - protos.google.cloud.aiplatform.v1beta1.IGetNasTrialDetailRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getNasTrialDetail(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 {@link google.cloud.aiplatform.v1beta1.BatchPredictionJob | 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 {@link google.cloud.aiplatform.v1beta1.BatchPredictionJob | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob | 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 {@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob | 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 {@link google.protobuf.Empty | 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 {@link google.protobuf.Empty | 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 NasJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the NasJob resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_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_DeleteNasJob_async - */ - deleteNasJob( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteNasJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteNasJob( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteNasJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteNasJob( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteNasJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteNasJob( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteNasJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteNasJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteNasJob()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://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_DeleteNasJob_async - */ - async checkDeleteNasJobProgress(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.deleteNasJob, 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1beta1.CustomJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1beta1.CustomJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 - * {@link google.cloud.aiplatform.v1beta1.CustomJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1beta1.DataLabelingJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1beta1.DataLabelingJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 - * {@link google.cloud.aiplatform.v1beta1.DataLabelingJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 - * {@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob | 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 NasJobs 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 NasJobs - * 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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.ListNasJobsResponse.next_page_token|ListNasJobsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1beta1.JobService.ListNasJobs|JobService.ListNasJobs} - * 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 {@link google.cloud.aiplatform.v1beta1.NasJob | NasJob}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listNasJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listNasJobs( - request?: protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.INasJob[], - protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListNasJobsResponse - ]>; - listNasJobs( - request: protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListNasJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.INasJob>): void; - listNasJobs( - request: protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListNasJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.INasJob>): void; - listNasJobs( - request?: protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListNasJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.INasJob>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListNasJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.INasJob>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.INasJob[], - protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListNasJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listNasJobs(request, options, callback); - } - -/** - * Equivalent to `method.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 NasJobs - * 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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.ListNasJobsResponse.next_page_token|ListNasJobsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1beta1.JobService.ListNasJobs|JobService.ListNasJobs} - * 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 {@link google.cloud.aiplatform.v1beta1.NasJob | NasJob} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listNasJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listNasJobsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, - 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['listNasJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listNasJobs.createStream( - this.innerApiCalls.listNasJobs as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listNasJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with 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 NasJobs - * 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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.ListNasJobsResponse.next_page_token|ListNasJobsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1beta1.JobService.ListNasJobs|JobService.ListNasJobs} - * 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 - * {@link google.cloud.aiplatform.v1beta1.NasJob | NasJob}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see 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_ListNasJobs_async - */ - listNasJobsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListNasJobsRequest, - 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['listNasJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listNasJobs.asyncIterate( - this.innerApiCalls['listNasJobs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List top NasTrialDetails of a NasJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the NasJob resource. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_job}` - * @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.ListNasTrialDetailsResponse.next_page_token|ListNasTrialDetailsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1beta1.JobService.ListNasTrialDetails|JobService.ListNasTrialDetails} - * call. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.cloud.aiplatform.v1beta1.NasTrialDetail | NasTrialDetail}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listNasTrialDetailsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listNasTrialDetails( - request?: protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.INasTrialDetail[], - protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsResponse - ]>; - listNasTrialDetails( - request: protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, - protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.INasTrialDetail>): void; - listNasTrialDetails( - request: protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, - protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.INasTrialDetail>): void; - listNasTrialDetails( - request?: protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, - protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.INasTrialDetail>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, - protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.INasTrialDetail>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.INasTrialDetail[], - protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listNasTrialDetails(request, options, callback); - } - -/** - * Equivalent to `method.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 NasJob resource. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_job}` - * @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.ListNasTrialDetailsResponse.next_page_token|ListNasTrialDetailsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1beta1.JobService.ListNasTrialDetails|JobService.ListNasTrialDetails} - * call. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.cloud.aiplatform.v1beta1.NasTrialDetail | NasTrialDetail} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listNasTrialDetailsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listNasTrialDetailsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, - 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['listNasTrialDetails']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listNasTrialDetails.createStream( - this.innerApiCalls.listNasTrialDetails as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listNasTrialDetails`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with 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 NasJob resource. - * Format: - * `projects/{project}/locations/{location}/nasJobs/{nas_job}` - * @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.ListNasTrialDetailsResponse.next_page_token|ListNasTrialDetailsResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1beta1.JobService.ListNasTrialDetails|JobService.ListNasTrialDetails} - * call. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.aiplatform.v1beta1.NasTrialDetail | NasTrialDetail}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see 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_ListNasTrialDetails_async - */ - listNasTrialDetailsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListNasTrialDetailsRequest, - 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['listNasTrialDetails']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listNasTrialDetails.asyncIterate( - this.innerApiCalls['listNasTrialDetails'] 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1beta1.BatchPredictionJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1beta1.BatchPredictionJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 - * {@link google.cloud.aiplatform.v1beta1.BatchPredictionJob | 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 {@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies | 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 {@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies | 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 - * {@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 {@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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"` - * * `labels.keyA=valueA` - * * `labels.keyB:*` - * @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 - * {@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client_config.json deleted file mode 100644 index 4e60f4b5ff8..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_client_config.json +++ /dev/null @@ -1,194 +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" - }, - "CreateNasJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetNasJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListNasJobs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteNasJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelNasJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetNasTrialDetail": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListNasTrialDetails": { - "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/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/job_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client.ts deleted file mode 100644 index 343ca9a9cf7..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client.ts +++ /dev/null @@ -1,2999 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, 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/match_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './match_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * MatchService is a Google managed service for efficient vector similarity - * search at scale. - * @class - * @memberof v1beta1 - */ -export class MatchServiceClient { - 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}; - matchServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of MatchServiceClient. - * - * @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 MatchServiceClient({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 MatchServiceClient; - 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.MatchService', 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.matchServiceStub) { - return this.matchServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.MatchService. - this.matchServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.MatchService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.MatchService, - 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 matchServiceStubMethods = - ['findNeighbors', 'readIndexDatapoints']; - for (const methodName of matchServiceStubMethods) { - const callPromise = this.matchServiceStub.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.matchServiceStub; - } - - /** - * 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 -- - // ------------------- -/** - * Finds the nearest neighbors of each vector within the request. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.indexEndpoint - * Required. The name of the index endpoint. - * Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param {string} request.deployedIndexId - * The ID of the DeployedIndex that will serve the request. This request is - * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That - * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index - * has a DeployedIndex.id field. - * The value of the field below must equal one of the DeployedIndex.id - * fields of the IndexEndpoint that is being called for this request. - * @param {number[]} request.queries - * The list of queries. - * @param {boolean} request.returnFullDatapoint - * If set to true, the full datapoints (including all vector values and - * restricts) of the nearest neighbors are returned. - * Note that returning full datapoint will significantly increase the - * latency and cost of the query. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.aiplatform.v1beta1.FindNeighborsResponse | FindNeighborsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MatchService_FindNeighbors_async - */ - findNeighbors( - request?: protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IFindNeighborsResponse, - protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest|undefined, {}|undefined - ]>; - findNeighbors( - request: protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IFindNeighborsResponse, - protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest|null|undefined, - {}|null|undefined>): void; - findNeighbors( - request: protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IFindNeighborsResponse, - protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest|null|undefined, - {}|null|undefined>): void; - findNeighbors( - request?: protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IFindNeighborsResponse, - protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IFindNeighborsResponse, - protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IFindNeighborsResponse, - protos.google.cloud.aiplatform.v1beta1.IFindNeighborsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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.findNeighbors(request, options, callback); - } -/** - * Reads the datapoints/vectors of the given IDs. - * A maximum of 1000 datapoints can be retrieved in a batch. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.indexEndpoint - * Required. The name of the index endpoint. - * Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param {string} request.deployedIndexId - * The ID of the DeployedIndex that will serve the request. - * @param {string[]} request.ids - * IDs of the datapoints to be searched for. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.aiplatform.v1beta1.ReadIndexDatapointsResponse | ReadIndexDatapointsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MatchService_ReadIndexDatapoints_async - */ - readIndexDatapoints( - request?: protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest|undefined, {}|undefined - ]>; - readIndexDatapoints( - request: protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest|null|undefined, - {}|null|undefined>): void; - readIndexDatapoints( - request: protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest|null|undefined, - {}|null|undefined>): void; - readIndexDatapoints( - request?: protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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.readIndexDatapoints(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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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); - } - - // -------------------- - // -- 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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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.matchServiceStub && !this._terminated) { - return this.matchServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.iamClient.close(); - this.locationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client_config.json deleted file mode 100644 index 935371a2a10..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_client_config.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.MatchService": { - "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": { - "FindNeighbors": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ReadIndexDatapoints": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/match_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client.ts deleted file mode 100644 index c46c4cd81b9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client.ts +++ /dev/null @@ -1,6856 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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', 'removeContextChildren', '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 {@link google.cloud.aiplatform.v1beta1.MetadataStore | 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 {@link google.cloud.aiplatform.v1beta1.Artifact | 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 {@link google.cloud.aiplatform.v1beta1.Artifact | 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 {@link google.cloud.aiplatform.v1beta1.Artifact | 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 {@link google.cloud.aiplatform.v1beta1.Context | 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 {@link google.cloud.aiplatform.v1beta1.Context | 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 {@link google.cloud.aiplatform.v1beta1.Context | 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 {@link google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsResponse | 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 {@link google.cloud.aiplatform.v1beta1.AddContextChildrenResponse | 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); - } -/** - * Remove a set of children contexts from a parent Context. If any of the - * child Contexts were NOT added to the parent 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 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 {@link google.cloud.aiplatform.v1beta1.RemoveContextChildrenResponse | RemoveContextChildrenResponse}. - * Please see the - * [documentation](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_RemoveContextChildren_async - */ - removeContextChildren( - request?: protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenResponse, - protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest|undefined, {}|undefined - ]>; - removeContextChildren( - request: protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenResponse, - protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest|null|undefined, - {}|null|undefined>): void; - removeContextChildren( - request: protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenResponse, - protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest|null|undefined, - {}|null|undefined>): void; - removeContextChildren( - request?: protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenResponse, - protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenResponse, - protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenResponse, - protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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.removeContextChildren(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 {@link google.cloud.aiplatform.v1beta1.LineageSubgraph | 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 {@link google.cloud.aiplatform.v1beta1.Execution | 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 {@link google.cloud.aiplatform.v1beta1.Execution | 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 {@link google.cloud.aiplatform.v1beta1.Execution | 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 {@link google.cloud.aiplatform.v1beta1.AddExecutionEventsResponse | 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 {@link google.cloud.aiplatform.v1beta1.LineageSubgraph | 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 {@link google.cloud.aiplatform.v1beta1.MetadataSchema | 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 {@link google.cloud.aiplatform.v1beta1.MetadataSchema | 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`). Maximum nested expression depth allowed - * is 5. - * - * 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 {@link google.cloud.aiplatform.v1beta1.LineageSubgraph | 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 {@link google.cloud.aiplatform.v1beta1.MetadataStore | 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 {@link google.cloud.aiplatform.v1beta1.MetadataStore | 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 - * {@link google.cloud.aiplatform.v1beta1.MetadataStore | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.cloud.aiplatform.v1beta1.Artifact | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.cloud.aiplatform.v1beta1.Artifact | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.aiplatform.v1beta1.Artifact | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.cloud.aiplatform.v1beta1.Context | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.cloud.aiplatform.v1beta1.Context | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.aiplatform.v1beta1.Context | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.cloud.aiplatform.v1beta1.Execution | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.cloud.aiplatform.v1beta1.Execution | 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`). Maximum nested expression depth allowed - * is 5. - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {string} request.orderBy - * How the list of messages is ordered. Specify the values to order by and an - * ordering operation. The default sorting order is ascending. To specify - * descending order for a field, users append a " desc" suffix; for example: - * "foo desc, bar". - * Subfields are specified with a `.` character, such as foo.bar. - * see https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.aiplatform.v1beta1.Execution | 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 {@link google.cloud.aiplatform.v1beta1.MetadataSchema | 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 {@link google.cloud.aiplatform.v1beta1.MetadataSchema | 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 - * {@link google.cloud.aiplatform.v1beta1.MetadataSchema | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client_config.json deleted file mode 100644 index feb78d10759..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_client_config.json +++ /dev/null @@ -1,179 +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" - }, - "RemoveContextChildren": { - "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/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/metadata_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client.ts deleted file mode 100644 index 2c2d8cc6e1a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client.ts +++ /dev/null @@ -1,3421 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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 {@link google.cloud.aiplatform.v1beta1.MigratableResource | 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 {@link google.cloud.aiplatform.v1beta1.MigratableResource | 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 - * {@link google.cloud.aiplatform.v1beta1.MigratableResource | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_client_config.json deleted file mode 100644 index 10583430c90..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/migration_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client.ts deleted file mode 100644 index 71e91035504..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client.ts +++ /dev/null @@ -1,5310 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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; - const copyModelResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.CopyModelResponse') as gax.protobuf.Type; - const copyModelMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.CopyModelOperationMetadata') 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)), - copyModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - copyModelResponse.decode.bind(copyModelResponse), - copyModelMetadata.decode.bind(copyModelMetadata)) - }; - - // 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', 'copyModel', 'importModelEvaluation', 'batchImportModelEvaluationSlices', 'batchImportEvaluatedAnnotations', '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 {@link google.cloud.aiplatform.v1beta1.Model | 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 {@link google.cloud.aiplatform.v1beta1.Model | 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 {@link google.cloud.aiplatform.v1beta1.Model | 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 {@link google.cloud.aiplatform.v1beta1.ModelEvaluation | 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 {@link google.cloud.aiplatform.v1beta1.BatchImportModelEvaluationSlicesResponse | 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); - } -/** - * Imports a list of externally generated EvaluatedAnnotations. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent ModelEvaluationSlice resource. - * Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` - * @param {number[]} request.evaluatedAnnotations - * Required. Evaluated annotations 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 {@link google.cloud.aiplatform.v1beta1.BatchImportEvaluatedAnnotationsResponse | BatchImportEvaluatedAnnotationsResponse}. - * Please see the - * [documentation](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_BatchImportEvaluatedAnnotations_async - */ - batchImportEvaluatedAnnotations( - request?: protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest|undefined, {}|undefined - ]>; - batchImportEvaluatedAnnotations( - request: protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest|null|undefined, - {}|null|undefined>): void; - batchImportEvaluatedAnnotations( - request: protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest|null|undefined, - {}|null|undefined>): void; - batchImportEvaluatedAnnotations( - request?: protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.batchImportEvaluatedAnnotations(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 {@link google.cloud.aiplatform.v1beta1.ModelEvaluation | 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 {@link google.cloud.aiplatform.v1beta1.ModelEvaluationSlice | 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 {string} [request.serviceAccount] - * Optional. The user-provided custom service account to use to do the model - * upload. If empty, [Vertex AI Service - * Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) - * will be used. Users uploading the Model must have the - * `iam.serviceAccounts.actAs` permission on this service account. Also, this - * account must belong to the project specified in the `parent` field and have - * all necessary read permissions. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://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 google.cloud.aiplatform.v1beta1.DeployedModel|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 - * [supported export - * format][google.cloud.aiplatform.v1beta1.Model.supported_export_formats]. - * - * @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; - } -/** - * Copies an already existing Vertex AI Model into the specified Location. - * The source Model must exist in the same Project. - * When copying custom Models, the users themselves are responsible for - * {@link google.cloud.aiplatform.v1beta1.Model.metadata|Model.metadata} content to - * be region-agnostic, as well as making sure that any resources (e.g. files) - * it depends on remain accessible. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} [request.modelId] - * Optional. Copy source_model into a new Model with this ID. The ID 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 {string} [request.parentModel] - * Optional. Specify this field to copy source_model into this existing - * Model as a new version. Format: - * `projects/{project}/locations/{location}/models/{model}` - * @param {string} request.parent - * Required. The resource name of the Location into which to copy the Model. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.sourceModel - * Required. The resource name of the Model to copy. That Model must be in the - * same Project. Format: - * `projects/{project}/locations/{location}/models/{model}` - * @param {google.cloud.aiplatform.v1beta1.EncryptionSpec} request.encryptionSpec - * Customer-managed encryption key options. If this is set, - * then the Model copy will be encrypted with the provided encryption key. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://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_CopyModel_async - */ - copyModel( - request?: protos.google.cloud.aiplatform.v1beta1.ICopyModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - copyModel( - request: protos.google.cloud.aiplatform.v1beta1.ICopyModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - copyModel( - request: protos.google.cloud.aiplatform.v1beta1.ICopyModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - copyModel( - request?: protos.google.cloud.aiplatform.v1beta1.ICopyModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.copyModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `copyModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://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_CopyModel_async - */ - async checkCopyModelProgress(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.copyModel, 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 [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"` - * @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 {@link google.cloud.aiplatform.v1beta1.Model | 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 [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"` - * @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 {@link google.cloud.aiplatform.v1beta1.Model | 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 [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"` - * @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 - * {@link google.cloud.aiplatform.v1beta1.Model | 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|next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions|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 {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` - * - * Example: `update_time asc, 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 {@link google.cloud.aiplatform.v1beta1.Model | 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|next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions|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 {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` - * - * Example: `update_time asc, 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 {@link google.cloud.aiplatform.v1beta1.Model | 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|next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions|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 {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` - * - * Example: `update_time asc, 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 - * {@link google.cloud.aiplatform.v1beta1.Model | 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 {@link google.cloud.aiplatform.v1beta1.ModelEvaluation | 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 {@link google.cloud.aiplatform.v1beta1.ModelEvaluation | 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 - * {@link google.cloud.aiplatform.v1beta1.ModelEvaluation | 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 {@link google.cloud.aiplatform.v1beta1.ModelEvaluationSlice | 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 {@link google.cloud.aiplatform.v1beta1.ModelEvaluationSlice | 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 - * {@link google.cloud.aiplatform.v1beta1.ModelEvaluationSlice | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client_config.json deleted file mode 100644 index d073f2cc96c..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_client_config.json +++ /dev/null @@ -1,109 +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" - }, - "CopyModel": { - "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" - }, - "BatchImportEvaluatedAnnotations": { - "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/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/model_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client.ts deleted file mode 100644 index 0070d2fd0b8..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client.ts +++ /dev/null @@ -1,4369 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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 {@link google.cloud.aiplatform.v1beta1.TrainingPipeline | 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 {@link google.cloud.aiplatform.v1beta1.TrainingPipeline | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1beta1.PipelineJob | 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 {@link google.cloud.aiplatform.v1beta1.PipelineJob | 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 {@link google.protobuf.Empty | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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 {@link google.cloud.aiplatform.v1beta1.TrainingPipeline | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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 {@link google.cloud.aiplatform.v1beta1.TrainingPipeline | 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. - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* - key existence - * - * 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 - * {@link google.cloud.aiplatform.v1beta1.TrainingPipeline | 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 {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields 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 {@link google.cloud.aiplatform.v1beta1.PipelineJob | 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 {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields 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 {@link google.cloud.aiplatform.v1beta1.PipelineJob | 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 {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields 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 - * {@link google.cloud.aiplatform.v1beta1.PipelineJob | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_client_config.json deleted file mode 100644 index dfa51e952eb..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/pipeline_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client.ts deleted file mode 100644 index 4237e832399..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client.ts +++ /dev/null @@ -1,3136 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, 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}; - 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.PredictionService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = 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' [Model's - * ][google.cloud.aiplatform.v1beta1.DeployedModel.model] - * {@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 {@link google.cloud.aiplatform.v1beta1.PredictResponse | 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 {@link google.api.HttpBody | 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' [Model's - * ][google.cloud.aiplatform.v1beta1.DeployedModel.model] - * {@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 {@link google.cloud.aiplatform.v1beta1.ExplainResponse | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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); - } - - // -------------------- - // -- 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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_client_config.json deleted file mode 100644 index 475b31fcf31..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/prediction_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client.ts deleted file mode 100644 index 5706d059cf7..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client.ts +++ /dev/null @@ -1,3835 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/schedule_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './schedule_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * A service for creating and managing Vertex AI's Schedule resources to - * periodically launch shceudled runs to make API calls. - * @class - * @memberof v1beta1 - */ -export class ScheduleServiceClient { - 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; - scheduleServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ScheduleServiceClient. - * - * @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 ScheduleServiceClient({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 ScheduleServiceClient; - 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - 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 = { - listSchedules: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'schedules') - }; - - 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const deleteScheduleResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteScheduleMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - deleteSchedule: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteScheduleResponse.decode.bind(deleteScheduleResponse), - deleteScheduleMetadata.decode.bind(deleteScheduleMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.ScheduleService', 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.scheduleServiceStub) { - return this.scheduleServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.ScheduleService. - this.scheduleServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.ScheduleService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.ScheduleService, - 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 scheduleServiceStubMethods = - ['createSchedule', 'deleteSchedule', 'getSchedule', 'listSchedules', 'pauseSchedule', 'resumeSchedule']; - for (const methodName of scheduleServiceStubMethods) { - const callPromise = this.scheduleServiceStub.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.scheduleServiceStub; - } - - /** - * 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 Schedule. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the Schedule in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1beta1.Schedule} request.schedule - * Required. The Schedule 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 {@link google.cloud.aiplatform.v1beta1.Schedule | Schedule}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ScheduleService_CreateSchedule_async - */ - createSchedule( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ISchedule, - protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest|undefined, {}|undefined - ]>; - createSchedule( - request: protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ISchedule, - protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest|null|undefined, - {}|null|undefined>): void; - createSchedule( - request: protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ISchedule, - protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest|null|undefined, - {}|null|undefined>): void; - createSchedule( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ISchedule, - protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ISchedule, - protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ISchedule, - protos.google.cloud.aiplatform.v1beta1.ICreateScheduleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createSchedule(request, options, callback); - } -/** - * Gets a Schedule. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Schedule resource. - * Format: - * `projects/{project}/locations/{location}/schedules/{schedule}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.aiplatform.v1beta1.Schedule | Schedule}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ScheduleService_GetSchedule_async - */ - getSchedule( - request?: protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ISchedule, - protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest|undefined, {}|undefined - ]>; - getSchedule( - request: protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ISchedule, - protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest|null|undefined, - {}|null|undefined>): void; - getSchedule( - request: protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ISchedule, - protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest|null|undefined, - {}|null|undefined>): void; - getSchedule( - request?: protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ISchedule, - protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ISchedule, - protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ISchedule, - protos.google.cloud.aiplatform.v1beta1.IGetScheduleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getSchedule(request, options, callback); - } -/** - * Pauses a Schedule. Will mark - * {@link google.cloud.aiplatform.v1beta1.Schedule.state|Schedule.state} to - * 'PAUSED'. If the schedule is paused, no new runs will be created. Already - * created runs will NOT be paused or canceled. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Schedule resource to be paused. - * Format: - * `projects/{project}/locations/{location}/schedules/{schedule}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.protobuf.Empty | 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_ScheduleService_PauseSchedule_async - */ - pauseSchedule( - request?: protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest|undefined, {}|undefined - ]>; - pauseSchedule( - request: protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest|null|undefined, - {}|null|undefined>): void; - pauseSchedule( - request: protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest|null|undefined, - {}|null|undefined>): void; - pauseSchedule( - request?: protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IPauseScheduleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.pauseSchedule(request, options, callback); - } -/** - * Resumes a paused Schedule to start scheduling new runs. Will mark - * {@link google.cloud.aiplatform.v1beta1.Schedule.state|Schedule.state} to - * 'ACTIVE'. Only paused Schedule can be resumed. - * - * When the Schedule is resumed, new runs will be scheduled starting from the - * next execution time after the current time based on the time_specification - * in the Schedule. If {@link |Schedule.catchUp} is set up true, all - * missed runs will be scheduled for backfill first. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Schedule resource to be resumed. - * Format: - * `projects/{project}/locations/{location}/schedules/{schedule}` - * @param {boolean} [request.catchUp] - * Optional. Whether to backfill missed runs when the schedule is resumed from - * PAUSED state. If set to true, all missed runs will be scheduled. New runs - * will be scheduled after the backfill is complete. This will also update - * {@link google.cloud.aiplatform.v1beta1.Schedule.catch_up|Schedule.catch_up} - * field. Default to false. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.protobuf.Empty | 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_ScheduleService_ResumeSchedule_async - */ - resumeSchedule( - request?: protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest|undefined, {}|undefined - ]>; - resumeSchedule( - request: protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest|null|undefined, - {}|null|undefined>): void; - resumeSchedule( - request: protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest|null|undefined, - {}|null|undefined>): void; - resumeSchedule( - request?: protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IResumeScheduleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.resumeSchedule(request, options, callback); - } - -/** - * Deletes a Schedule. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Schedule resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/schedules/{schedule}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ScheduleService_DeleteSchedule_async - */ - deleteSchedule( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteScheduleRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteSchedule( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteScheduleRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteSchedule( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteScheduleRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteSchedule( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteScheduleRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteSchedule(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteSchedule()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ScheduleService_DeleteSchedule_async - */ - async checkDeleteScheduleProgress(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.deleteSchedule, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Schedules 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 Schedules from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the Schedules that match the filter expression. The following - * fields are supported: - * - * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `state`: Supports `=` and `!=` comparisons. - * * `request`: Supports existence of the check. - * (e.g. `create_pipeline_job_request:*` --> Schedule has - * create_pipeline_job_request). - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `start_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, `>=` comparisons and `:*` - * existence check. Values must be in RFC 3339 format. - * * `next_run_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` - * comparisons. Values must be in RFC 3339 format. - * - * - * Filter expressions can be combined together using logical operators - * (`NOT`, `AND` & `OR`). - * The syntax to define filter expression is based on - * https://google.aip.dev/160. - * - * Examples: - * - * * `state="ACTIVE" AND display_name:"my_schedule_*"` - * * `NOT display_name="my_schedule"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `end_time>"2021-05-18T00:00:00Z" OR NOT end_time:*` - * * `create_pipeline_job_request:*` - * @param {number} request.pageSize - * The standard list page size. - * Default to 100 if not specified. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListSchedulesResponse.next_page_token|ListSchedulesResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1beta1.ScheduleService.ListSchedules|ScheduleService.ListSchedules} - * 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. - * - * For example, using "create_time desc, end_time" will order results by - * create time in descending order, and if there are multiple schedules 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 with create_time in - * descending order. - * - * Supported fields: - * * `create_time` - * * `start_time` - * * `end_time` - * * `next_run_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 {@link google.cloud.aiplatform.v1beta1.Schedule | Schedule}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listSchedulesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listSchedules( - request?: protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ISchedule[], - protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListSchedulesResponse - ]>; - listSchedules( - request: protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, - protos.google.cloud.aiplatform.v1beta1.IListSchedulesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ISchedule>): void; - listSchedules( - request: protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, - protos.google.cloud.aiplatform.v1beta1.IListSchedulesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ISchedule>): void; - listSchedules( - request?: protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, - protos.google.cloud.aiplatform.v1beta1.IListSchedulesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ISchedule>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, - protos.google.cloud.aiplatform.v1beta1.IListSchedulesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ISchedule>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ISchedule[], - protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListSchedulesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listSchedules(request, options, callback); - } - -/** - * Equivalent to `method.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 Schedules from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the Schedules that match the filter expression. The following - * fields are supported: - * - * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `state`: Supports `=` and `!=` comparisons. - * * `request`: Supports existence of the check. - * (e.g. `create_pipeline_job_request:*` --> Schedule has - * create_pipeline_job_request). - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `start_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, `>=` comparisons and `:*` - * existence check. Values must be in RFC 3339 format. - * * `next_run_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` - * comparisons. Values must be in RFC 3339 format. - * - * - * Filter expressions can be combined together using logical operators - * (`NOT`, `AND` & `OR`). - * The syntax to define filter expression is based on - * https://google.aip.dev/160. - * - * Examples: - * - * * `state="ACTIVE" AND display_name:"my_schedule_*"` - * * `NOT display_name="my_schedule"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `end_time>"2021-05-18T00:00:00Z" OR NOT end_time:*` - * * `create_pipeline_job_request:*` - * @param {number} request.pageSize - * The standard list page size. - * Default to 100 if not specified. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListSchedulesResponse.next_page_token|ListSchedulesResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1beta1.ScheduleService.ListSchedules|ScheduleService.ListSchedules} - * 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. - * - * For example, using "create_time desc, end_time" will order results by - * create time in descending order, and if there are multiple schedules 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 with create_time in - * descending order. - * - * Supported fields: - * * `create_time` - * * `start_time` - * * `end_time` - * * `next_run_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 {@link google.cloud.aiplatform.v1beta1.Schedule | Schedule} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listSchedulesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listSchedulesStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, - 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['listSchedules']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSchedules.createStream( - this.innerApiCalls.listSchedules as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSchedules`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with 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 Schedules from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the Schedules that match the filter expression. The following - * fields are supported: - * - * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `state`: Supports `=` and `!=` comparisons. - * * `request`: Supports existence of the check. - * (e.g. `create_pipeline_job_request:*` --> Schedule has - * create_pipeline_job_request). - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `start_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, `>=` comparisons and `:*` - * existence check. Values must be in RFC 3339 format. - * * `next_run_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` - * comparisons. Values must be in RFC 3339 format. - * - * - * Filter expressions can be combined together using logical operators - * (`NOT`, `AND` & `OR`). - * The syntax to define filter expression is based on - * https://google.aip.dev/160. - * - * Examples: - * - * * `state="ACTIVE" AND display_name:"my_schedule_*"` - * * `NOT display_name="my_schedule"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `end_time>"2021-05-18T00:00:00Z" OR NOT end_time:*` - * * `create_pipeline_job_request:*` - * @param {number} request.pageSize - * The standard list page size. - * Default to 100 if not specified. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListSchedulesResponse.next_page_token|ListSchedulesResponse.next_page_token} - * of the previous - * {@link google.cloud.aiplatform.v1beta1.ScheduleService.ListSchedules|ScheduleService.ListSchedules} - * 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. - * - * For example, using "create_time desc, end_time" will order results by - * create time in descending order, and if there are multiple schedules 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 with create_time in - * descending order. - * - * Supported fields: - * * `create_time` - * * `start_time` - * * `end_time` - * * `next_run_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 - * {@link google.cloud.aiplatform.v1beta1.Schedule | Schedule}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see 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_ScheduleService_ListSchedules_async - */ - listSchedulesAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListSchedulesRequest, - 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['listSchedules']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSchedules.asyncIterate( - this.innerApiCalls['listSchedules'] 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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.scheduleServiceStub && !this._terminated) { - return this.scheduleServiceStub.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/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client_config.json deleted file mode 100644 index 10258b57ae6..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_client_config.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.ScheduleService": { - "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": { - "CreateSchedule": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteSchedule": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetSchedule": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListSchedules": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PauseSchedule": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ResumeSchedule": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/schedule_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client.ts deleted file mode 100644 index aa6b1c1685f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client.ts +++ /dev/null @@ -1,3668 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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 {@link google.cloud.aiplatform.v1beta1.SpecialistPool | 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 {@link google.cloud.aiplatform.v1beta1.SpecialistPool | 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 {@link google.cloud.aiplatform.v1beta1.SpecialistPool | 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 - * {@link google.cloud.aiplatform.v1beta1.SpecialistPool | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_client_config.json deleted file mode 100644 index c39dc80ff47..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client.ts deleted file mode 100644 index 02588abe1df..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client.ts +++ /dev/null @@ -1,6238 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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', 'readTensorboardUsage', '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 {@link google.cloud.aiplatform.v1beta1.Tensorboard | 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); - } -/** - * Returns a list of monthly active users for a given TensorBoard instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tensorboard - * 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 {@link google.cloud.aiplatform.v1beta1.ReadTensorboardUsageResponse | ReadTensorboardUsageResponse}. - * Please see the - * [documentation](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_ReadTensorboardUsage_async - */ - readTensorboardUsage( - request?: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageResponse, - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest|undefined, {}|undefined - ]>; - readTensorboardUsage( - request: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageResponse, - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest|null|undefined, - {}|null|undefined>): void; - readTensorboardUsage( - request: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageResponse, - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest|null|undefined, - {}|null|undefined>): void; - readTensorboardUsage( - request?: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageResponse, - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageResponse, - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageResponse, - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as 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.readTensorboardUsage(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 becomes 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 {@link google.cloud.aiplatform.v1beta1.TensorboardExperiment | 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 {@link google.cloud.aiplatform.v1beta1.TensorboardExperiment | 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 is overwritten if it's in the mask. If the - * user does not provide a mask then all fields are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardExperiment | 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 becomes 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 {@link google.cloud.aiplatform.v1beta1.TensorboardRun | 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 {@link google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsResponse | 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 {@link google.cloud.aiplatform.v1beta1.TensorboardRun | 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 is overwritten if it's in the mask. If the - * user does not provide a mask then all fields are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardRun | 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 {@link google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesResponse | 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 becomes 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 {@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries | 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 {@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries | 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 is overwritten if it's in the mask. If the - * user does not provide a mask then all fields are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries | 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 is returned. - * Otherwise, the number limit of data points is 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 {@link google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataResponse | 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 is returned. Otherwise, 1000 - * data points is 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 {@link google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataResponse | 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 is 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 {@link google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataResponse | 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 is 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 {@link google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataResponse | 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 {@link google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse | 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 is overwritten if it's in the mask. If the - * user does not provide a mask then all fields are 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 are - * returned. The maximum value is 100; values above 100 are 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 {@link google.cloud.aiplatform.v1beta1.Tensorboard | 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 are - * returned. The maximum value is 100; values above 100 are 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 {@link google.cloud.aiplatform.v1beta1.Tensorboard | 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 are - * returned. The maximum value is 100; values above 100 are 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 - * {@link google.cloud.aiplatform.v1beta1.Tensorboard | 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 are returned. The maximum value is 1000; values - * above 1000 are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardExperiment | 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 are returned. The maximum value is 1000; values - * above 1000 are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardExperiment | 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 are returned. The maximum value is 1000; values - * above 1000 are 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 - * {@link google.cloud.aiplatform.v1beta1.TensorboardExperiment | 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 are - * returned. The maximum value is 1000; values above 1000 are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardRun | 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 are - * returned. The maximum value is 1000; values above 1000 are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardRun | 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 are - * returned. The maximum value is 1000; values above 1000 are 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 - * {@link google.cloud.aiplatform.v1beta1.TensorboardRun | 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 are returned. The maximum value is 1000; values - * above 1000 are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries | 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 are returned. The maximum value is 1000; values - * above 1000 are 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 {@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries | 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 are returned. The maximum value is 1000; values - * above 1000 are 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 - * {@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries | 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 is 1000. Values must be between 1 and 10000. - * Values above 10000 are coerced to 10000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} - * 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 is 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 {@link google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint | 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 is 1000. Values must be between 1 and 10000. - * Values above 10000 are coerced to 10000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} - * 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 is 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 {@link google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint | 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 is 1000. Values must be between 1 and 10000. - * Values above 10000 are coerced to 10000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} - * 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 is 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 - * {@link google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client_config.json deleted file mode 100644 index 58394e25501..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_client_config.json +++ /dev/null @@ -1,142 +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" - }, - "ReadTensorboardUsage": { - "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/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/tensorboard_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client.ts deleted file mode 100644 index 93827f38ffe..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client.ts +++ /dev/null @@ -1,4492 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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}' - ), - 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}' - ), - nasJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}' - ), - nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - projectLocationPublisherModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - schedulePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/schedules/{schedule}' - ), - 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: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}: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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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/*/modelMonitors/*}/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/*/schedules/*}/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/*/modelMonitors/*}/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/*/persistentResources/*}/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/*/schedules/*}/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',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/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/*/modelMonitors/*/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/*/schedules/*/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/*/modelMonitors/*/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/*/persistentResources/*/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/*/schedules/*/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',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/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 {@link google.cloud.aiplatform.v1beta1.Study | 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 {@link google.cloud.aiplatform.v1beta1.Study | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1beta1.Study | 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 {@link google.cloud.aiplatform.v1beta1.Trial | 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 {@link google.cloud.aiplatform.v1beta1.Trial | 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 {@link google.cloud.aiplatform.v1beta1.Trial | 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 {@link google.cloud.aiplatform.v1beta1.Trial | 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 {@link google.protobuf.Empty | 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 {@link google.cloud.aiplatform.v1beta1.Trial | 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 {@link google.cloud.aiplatform.v1beta1.ListOptimalTrialsResponse | 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.aiplatform.v1beta1.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 {@link google.cloud.aiplatform.v1beta1.Study | 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 {@link google.cloud.aiplatform.v1beta1.Study | 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 - * {@link google.cloud.aiplatform.v1beta1.Study | 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 {@link google.cloud.aiplatform.v1beta1.Trial | 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 {@link google.cloud.aiplatform.v1beta1.Trial | 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 - * {@link google.cloud.aiplatform.v1beta1.Trial | 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 {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | 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 {@link google.cloud.location.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 - * {@link google.cloud.location.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 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 nasJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @returns {string} Resource name string. - */ - nasJobPath(project:string,location:string,nasJob:string) { - return this.pathTemplates.nasJobPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - }); - } - - /** - * Parse the project from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; - } - - /** - * Parse the location from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; - } - - /** - * Parse the nas_job from NasJob resource. - * - * @param {string} nasJobName - * A fully-qualified path representing NasJob resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasJobName(nasJobName: string) { - return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; - } - - /** - * Return a fully-qualified nasTrialDetail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} nas_job - * @param {string} nas_trial_detail - * @returns {string} Resource name string. - */ - nasTrialDetailPath(project:string,location:string,nasJob:string,nasTrialDetail:string) { - return this.pathTemplates.nasTrialDetailPathTemplate.render({ - project: project, - location: location, - nas_job: nasJob, - nas_trial_detail: nasTrialDetail, - }); - } - - /** - * Parse the project from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).project; - } - - /** - * Parse the location from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).location; - } - - /** - * Parse the nas_job from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_job. - */ - matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_job; - } - - /** - * Parse the nas_trial_detail from NasTrialDetail resource. - * - * @param {string} nasTrialDetailName - * A fully-qualified path representing NasTrialDetail resource. - * @returns {string} A string representing the nas_trial_detail. - */ - matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { - return this.pathTemplates.nasTrialDetailPathTemplate.match(nasTrialDetailName).nas_trial_detail; - } - - /** - * 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 projectLocationEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - projectLocationEndpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).project; - } - - /** - * Parse the location from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).location; - } - - /** - * Parse the endpoint from ProjectLocationEndpoint resource. - * - * @param {string} projectLocationEndpointName - * A fully-qualified path representing project_location_endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromProjectLocationEndpointName(projectLocationEndpointName: string) { - return this.pathTemplates.projectLocationEndpointPathTemplate.match(projectLocationEndpointName).endpoint; - } - - /** - * Return a fully-qualified projectLocationPublisherModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} publisher - * @param {string} model - * @returns {string} Resource name string. - */ - projectLocationPublisherModelPath(project:string,location:string,publisher:string,model:string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ - project: project, - location: location, - publisher: publisher, - model: model, - }); - } - - /** - * Parse the project from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).project; - } - - /** - * Parse the location from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).location; - } - - /** - * Parse the publisher from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the publisher. - */ - matchPublisherFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).publisher; - } - - /** - * Parse the model from ProjectLocationPublisherModel resource. - * - * @param {string} projectLocationPublisherModelName - * A fully-qualified path representing project_location_publisher_model resource. - * @returns {string} A string representing the model. - */ - matchModelFromProjectLocationPublisherModelName(projectLocationPublisherModelName: string) { - return this.pathTemplates.projectLocationPublisherModelPathTemplate.match(projectLocationPublisherModelName).model; - } - - /** - * 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 schedule resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} schedule - * @returns {string} Resource name string. - */ - schedulePath(project:string,location:string,schedule:string) { - return this.pathTemplates.schedulePathTemplate.render({ - project: project, - location: location, - schedule: schedule, - }); - } - - /** - * Parse the project from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the project. - */ - matchProjectFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; - } - - /** - * Parse the location from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the location. - */ - matchLocationFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; - } - - /** - * Parse the schedule from Schedule resource. - * - * @param {string} scheduleName - * A fully-qualified path representing Schedule resource. - * @returns {string} A string representing the schedule. - */ - matchScheduleFromScheduleName(scheduleName: string) { - return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; - } - - /** - * 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/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client_config.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_client_config.json deleted file mode 100644 index 89e31e025cf..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_proto_list.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_proto_list.json deleted file mode 100644 index 9638e888ca9..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/src/v1beta1/vizier_service_proto_list.json +++ /dev/null @@ -1,127 +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/evaluated_annotation.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/match_service.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/nas_job.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/schedule.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/service_networking.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/google-cloud-aiplatform/v1beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index ba7cdcd7009..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 matchServiceClient = new aiplatform.MatchServiceClient(); - 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 scheduleServiceClient = new aiplatform.ScheduleServiceClient(); - const specialistPoolServiceClient = new aiplatform.SpecialistPoolServiceClient(); - const tensorboardServiceClient = new aiplatform.TensorboardServiceClient(); - const vizierServiceClient = new aiplatform.VizierServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index a023296296c..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, MatchServiceClient, MetadataServiceClient, MigrationServiceClient, ModelServiceClient, PipelineServiceClient, PredictionServiceClient, ScheduleServiceClient, 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 doStuffWithMatchServiceClient(client: MatchServiceClient) { - 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 doStuffWithScheduleServiceClient(client: ScheduleServiceClient) { - 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 matchServiceClient = new MatchServiceClient(); - doStuffWithMatchServiceClient(matchServiceClient); - // 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 scheduleServiceClient = new ScheduleServiceClient(); - doStuffWithScheduleServiceClient(scheduleServiceClient); - // 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/google-cloud-aiplatform/v1beta1/system-test/install.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/install.ts deleted file mode 100644 index c8f81b25a86..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/google-cloud-aiplatform/v1beta1/test/gapic_dataset_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_dataset_service_v1beta1.ts deleted file mode 100644 index 89f1ea74d25..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_dataset_service_v1beta1.ts +++ /dev/null @@ -1,5060 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('searchDataItems', () => { - it('invokes searchDataItems 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.SearchDataItemsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.SearchDataItemsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), - ]; - client.innerApiCalls.searchDataItems = stubSimpleCall(expectedResponse); - const [response] = await client.searchDataItems(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchDataItems as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchDataItems as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchDataItems 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.SearchDataItemsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.SearchDataItemsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), - ]; - client.innerApiCalls.searchDataItems = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchDataItems( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDataItemView[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchDataItems as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchDataItems as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchDataItems 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.SearchDataItemsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.SearchDataItemsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.searchDataItems = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchDataItems(request), expectedError); - const actualRequest = (client.innerApiCalls.searchDataItems as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchDataItems as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchDataItemsStream 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.SearchDataItemsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.SearchDataItemsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), - ]; - client.descriptors.page.searchDataItems.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchDataItemsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.DataItemView[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DataItemView) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.searchDataItems.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchDataItems, request)); - assert( - (client.descriptors.page.searchDataItems.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes searchDataItemsStream 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.SearchDataItemsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.SearchDataItemsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.searchDataItems.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchDataItemsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.DataItemView[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DataItemView) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.searchDataItems.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchDataItems, request)); - assert( - (client.descriptors.page.searchDataItems.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with searchDataItems 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.SearchDataItemsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.SearchDataItemsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItemView()), - ]; - client.descriptors.page.searchDataItems.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IDataItemView[] = []; - const iterable = client.searchDataItemsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.searchDataItems.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.searchDataItems.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with searchDataItems 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.SearchDataItemsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.SearchDataItemsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.searchDataItems.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchDataItemsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IDataItemView[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.searchDataItems.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.searchDataItems.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_deployment_resource_pool_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_deployment_resource_pool_service_v1beta1.ts deleted file mode 100644 index 8105616de05..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_deployment_resource_pool_service_v1beta1.ts +++ /dev/null @@ -1,3827 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_endpoint_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_endpoint_service_v1beta1.ts deleted file mode 100644 index f1bac393e28..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_endpoint_service_v1beta1.ts +++ /dev/null @@ -1,4126 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('mutateDeployedModel', () => { - it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.mutateDeployedModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.mutateDeployedModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.mutateDeployedModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.mutateDeployedModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.mutateDeployedModel( - request, - (err?: Error|null, - result?: 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.mutateDeployedModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.mutateDeployedModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.mutateDeployedModel(request), expectedError); - const actualRequest = (client.innerApiCalls.mutateDeployedModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.mutateDeployedModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.mutateDeployedModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.mutateDeployedModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkMutateDeployedModelProgress 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.checkMutateDeployedModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkMutateDeployedModelProgress 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.checkMutateDeployedModelProgress(''), 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts deleted file mode 100644 index 88d7edd6d2d..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts +++ /dev/null @@ -1,2882 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_service_v1beta1.ts deleted file mode 100644 index 45dde10588a..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_featurestore_service_v1beta1.ts +++ /dev/null @@ -1,6301 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('deleteFeatureValues', () => { - it('invokes deleteFeatureValues 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.DeleteFeatureValuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteFeatureValues = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteFeatureValues(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteFeatureValues 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.DeleteFeatureValuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteFeatureValues = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteFeatureValues( - request, - (err?: Error|null, - result?: 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.deleteFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteFeatureValues 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.DeleteFeatureValuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeatureValues = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteFeatureValues(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteFeatureValues 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.DeleteFeatureValuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteFeatureValues(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteFeatureValuesProgress 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.checkDeleteFeatureValuesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteFeatureValuesProgress 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.checkDeleteFeatureValuesProgress(''), 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts deleted file mode 100644 index ed60c31ce21..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts +++ /dev/null @@ -1,4126 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_index_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_service_v1beta1.ts deleted file mode 100644 index 4bc862ad739..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_index_service_v1beta1.ts +++ /dev/null @@ -1,3926 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_job_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_job_service_v1beta1.ts deleted file mode 100644 index dec47164817..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_job_service_v1beta1.ts +++ /dev/null @@ -1,8093 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('createNasJob', () => { - it('invokes createNasJob 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.CreateNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CreateNasJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.NasJob() - ); - client.innerApiCalls.createNasJob = stubSimpleCall(expectedResponse); - const [response] = await client.createNasJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNasJob 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.CreateNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CreateNasJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.NasJob() - ); - client.innerApiCalls.createNasJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createNasJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.INasJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNasJob 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.CreateNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CreateNasJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createNasJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createNasJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNasJob 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.CreateNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CreateNasJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createNasJob(request), expectedError); - }); - }); - - describe('getNasJob', () => { - it('invokes getNasJob 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.GetNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.NasJob() - ); - client.innerApiCalls.getNasJob = stubSimpleCall(expectedResponse); - const [response] = await client.getNasJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNasJob 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.GetNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.NasJob() - ); - client.innerApiCalls.getNasJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getNasJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.INasJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNasJob 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.GetNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getNasJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getNasJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNasJob 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.GetNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getNasJob(request), expectedError); - }); - }); - - describe('cancelNasJob', () => { - it('invokes cancelNasJob 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.CancelNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CancelNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelNasJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelNasJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelNasJob 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.CancelNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CancelNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelNasJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelNasJob( - 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.cancelNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelNasJob 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.CancelNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CancelNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelNasJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelNasJob(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelNasJob 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.CancelNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CancelNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelNasJob(request), expectedError); - }); - }); - - describe('getNasTrialDetail', () => { - it('invokes getNasTrialDetail 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.GetNasTrialDetailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetNasTrialDetailRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail() - ); - client.innerApiCalls.getNasTrialDetail = stubSimpleCall(expectedResponse); - const [response] = await client.getNasTrialDetail(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNasTrialDetail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNasTrialDetail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNasTrialDetail 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.GetNasTrialDetailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetNasTrialDetailRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail() - ); - client.innerApiCalls.getNasTrialDetail = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getNasTrialDetail( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.INasTrialDetail|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNasTrialDetail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNasTrialDetail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNasTrialDetail 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.GetNasTrialDetailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetNasTrialDetailRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getNasTrialDetail = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getNasTrialDetail(request), expectedError); - const actualRequest = (client.innerApiCalls.getNasTrialDetail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNasTrialDetail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNasTrialDetail 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.GetNasTrialDetailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetNasTrialDetailRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getNasTrialDetail(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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('deleteNasJob', () => { - it('invokes deleteNasJob 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.DeleteNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteNasJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteNasJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNasJob 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.DeleteNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteNasJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteNasJob( - request, - (err?: Error|null, - result?: 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.deleteNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNasJob 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.DeleteNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteNasJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteNasJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNasJob 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.DeleteNasJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteNasJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteNasJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteNasJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteNasJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNasJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteNasJobProgress 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.checkDeleteNasJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteNasJobProgress 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.checkDeleteNasJobProgress(''), 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('listNasJobs', () => { - it('invokes listNasJobs 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.ListNasJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), - ]; - client.innerApiCalls.listNasJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listNasJobs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNasJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNasJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNasJobs 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.ListNasJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), - ]; - client.innerApiCalls.listNasJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listNasJobs( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.INasJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNasJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNasJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNasJobs 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.ListNasJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listNasJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listNasJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listNasJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNasJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNasJobsStream 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.ListNasJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), - ]; - client.descriptors.page.listNasJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listNasJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.NasJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.NasJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listNasJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNasJobs, request)); - assert( - (client.descriptors.page.listNasJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listNasJobsStream 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.ListNasJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listNasJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listNasJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.NasJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.NasJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listNasJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNasJobs, request)); - assert( - (client.descriptors.page.listNasJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listNasJobs 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.ListNasJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasJob()), - ]; - client.descriptors.page.listNasJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.INasJob[] = []; - const iterable = client.listNasJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listNasJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listNasJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listNasJobs 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.ListNasJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listNasJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listNasJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.INasJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listNasJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listNasJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listNasTrialDetails', () => { - it('invokes listNasTrialDetails 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.ListNasTrialDetailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasTrialDetailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), - ]; - client.innerApiCalls.listNasTrialDetails = stubSimpleCall(expectedResponse); - const [response] = await client.listNasTrialDetails(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNasTrialDetails as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNasTrialDetails as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNasTrialDetails 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.ListNasTrialDetailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasTrialDetailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), - ]; - client.innerApiCalls.listNasTrialDetails = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listNasTrialDetails( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.INasTrialDetail[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNasTrialDetails as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNasTrialDetails as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNasTrialDetails 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.ListNasTrialDetailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasTrialDetailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listNasTrialDetails = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listNasTrialDetails(request), expectedError); - const actualRequest = (client.innerApiCalls.listNasTrialDetails as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNasTrialDetails as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNasTrialDetailsStream 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.ListNasTrialDetailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasTrialDetailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), - ]; - client.descriptors.page.listNasTrialDetails.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listNasTrialDetailsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.NasTrialDetail[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.NasTrialDetail) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listNasTrialDetails.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNasTrialDetails, request)); - assert( - (client.descriptors.page.listNasTrialDetails.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listNasTrialDetailsStream 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.ListNasTrialDetailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasTrialDetailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listNasTrialDetails.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listNasTrialDetailsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.NasTrialDetail[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.NasTrialDetail) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listNasTrialDetails.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNasTrialDetails, request)); - assert( - (client.descriptors.page.listNasTrialDetails.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listNasTrialDetails 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.ListNasTrialDetailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasTrialDetailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail()), - ]; - client.descriptors.page.listNasTrialDetails.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.INasTrialDetail[] = []; - const iterable = client.listNasTrialDetailsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listNasTrialDetails.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listNasTrialDetails.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listNasTrialDetails 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.ListNasTrialDetailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListNasTrialDetailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listNasTrialDetails.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listNasTrialDetailsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.INasTrialDetail[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listNasTrialDetails.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listNasTrialDetails.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_match_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_match_service_v1beta1.ts deleted file mode 100644 index 15a2065ecbf..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_match_service_v1beta1.ts +++ /dev/null @@ -1,2771 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 matchserviceModule from '../src'; - -import {protobuf, 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.MatchServiceClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = matchserviceModule.v1beta1.MatchServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = matchserviceModule.v1beta1.MatchServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = matchserviceModule.v1beta1.MatchServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new matchserviceModule.v1beta1.MatchServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.matchServiceStub, undefined); - await client.initialize(); - assert(client.matchServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.matchServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.matchServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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('findNeighbors', () => { - it('invokes findNeighbors without error', async () => { - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.FindNeighborsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.FindNeighborsRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.FindNeighborsResponse() - ); - client.innerApiCalls.findNeighbors = stubSimpleCall(expectedResponse); - const [response] = await client.findNeighbors(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.findNeighbors as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.findNeighbors as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes findNeighbors without error using callback', async () => { - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.FindNeighborsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.FindNeighborsRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.FindNeighborsResponse() - ); - client.innerApiCalls.findNeighbors = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.findNeighbors( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IFindNeighborsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.findNeighbors as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.findNeighbors as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes findNeighbors with error', async () => { - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.FindNeighborsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.FindNeighborsRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.findNeighbors = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.findNeighbors(request), expectedError); - const actualRequest = (client.innerApiCalls.findNeighbors as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.findNeighbors as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes findNeighbors with closed client', async () => { - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.FindNeighborsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.FindNeighborsRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.findNeighbors(request), expectedError); - }); - }); - - describe('readIndexDatapoints', () => { - it('invokes readIndexDatapoints without error', async () => { - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsResponse() - ); - client.innerApiCalls.readIndexDatapoints = stubSimpleCall(expectedResponse); - const [response] = await client.readIndexDatapoints(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.readIndexDatapoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readIndexDatapoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes readIndexDatapoints without error using callback', async () => { - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsResponse() - ); - client.innerApiCalls.readIndexDatapoints = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.readIndexDatapoints( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IReadIndexDatapointsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.readIndexDatapoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readIndexDatapoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes readIndexDatapoints with error', async () => { - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.readIndexDatapoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.readIndexDatapoints(request), expectedError); - const actualRequest = (client.innerApiCalls.readIndexDatapoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readIndexDatapoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes readIndexDatapoints with closed client', async () => { - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.readIndexDatapoints(request), expectedError); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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('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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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 matchserviceModule.v1beta1.MatchServiceClient({ - 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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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 matchserviceModule.v1beta1.MatchServiceClient({ - 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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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 matchserviceModule.v1beta1.MatchServiceClient({ - 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/google-cloud-aiplatform/v1beta1/test/gapic_metadata_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_metadata_service_v1beta1.ts deleted file mode 100644 index 00b86b1c760..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_metadata_service_v1beta1.ts +++ /dev/null @@ -1,7442 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('removeContextChildren', () => { - it('invokes removeContextChildren 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.RemoveContextChildrenRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.RemoveContextChildrenRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.RemoveContextChildrenResponse() - ); - client.innerApiCalls.removeContextChildren = stubSimpleCall(expectedResponse); - const [response] = await client.removeContextChildren(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.removeContextChildren as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.removeContextChildren as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes removeContextChildren 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.RemoveContextChildrenRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.RemoveContextChildrenRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.RemoveContextChildrenResponse() - ); - client.innerApiCalls.removeContextChildren = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.removeContextChildren( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IRemoveContextChildrenResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.removeContextChildren as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.removeContextChildren as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes removeContextChildren 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.RemoveContextChildrenRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.RemoveContextChildrenRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.removeContextChildren = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.removeContextChildren(request), expectedError); - const actualRequest = (client.innerApiCalls.removeContextChildren as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.removeContextChildren as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes removeContextChildren 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.RemoveContextChildrenRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.RemoveContextChildrenRequest', ['context']); - request.context = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.removeContextChildren(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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_migration_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_migration_service_v1beta1.ts deleted file mode 100644 index 928a20c8a83..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_migration_service_v1beta1.ts +++ /dev/null @@ -1,3290 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_model_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_model_service_v1beta1.ts deleted file mode 100644 index 2d1707f2c62..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_model_service_v1beta1.ts +++ /dev/null @@ -1,5663 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('batchImportEvaluatedAnnotations', () => { - it('invokes batchImportEvaluatedAnnotations 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.BatchImportEvaluatedAnnotationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.BatchImportEvaluatedAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.BatchImportEvaluatedAnnotationsResponse() - ); - client.innerApiCalls.batchImportEvaluatedAnnotations = stubSimpleCall(expectedResponse); - const [response] = await client.batchImportEvaluatedAnnotations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchImportEvaluatedAnnotations 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.BatchImportEvaluatedAnnotationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.BatchImportEvaluatedAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.BatchImportEvaluatedAnnotationsResponse() - ); - client.innerApiCalls.batchImportEvaluatedAnnotations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchImportEvaluatedAnnotations( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IBatchImportEvaluatedAnnotationsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchImportEvaluatedAnnotations 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.BatchImportEvaluatedAnnotationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.BatchImportEvaluatedAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchImportEvaluatedAnnotations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchImportEvaluatedAnnotations(request), expectedError); - const actualRequest = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchImportEvaluatedAnnotations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchImportEvaluatedAnnotations 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.BatchImportEvaluatedAnnotationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.BatchImportEvaluatedAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchImportEvaluatedAnnotations(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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('copyModel', () => { - it('invokes copyModel 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.CopyModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CopyModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.copyModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.copyModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.copyModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.copyModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes copyModel 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.CopyModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CopyModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.copyModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.copyModel( - request, - (err?: Error|null, - result?: 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.copyModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.copyModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes copyModel 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.CopyModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CopyModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.copyModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.copyModel(request), expectedError); - const actualRequest = (client.innerApiCalls.copyModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.copyModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes copyModel 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.CopyModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CopyModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.copyModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.copyModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.copyModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.copyModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCopyModelProgress 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.checkCopyModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCopyModelProgress 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.checkCopyModelProgress(''), 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_pipeline_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_pipeline_service_v1beta1.ts deleted file mode 100644 index 350e4356392..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_pipeline_service_v1beta1.ts +++ /dev/null @@ -1,4337 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_prediction_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_prediction_service_v1beta1.ts deleted file mode 100644 index 407695154a2..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_prediction_service_v1beta1.ts +++ /dev/null @@ -1,2879 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_schedule_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_schedule_service_v1beta1.ts deleted file mode 100644 index 711c6949928..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_schedule_service_v1beta1.ts +++ /dev/null @@ -1,3722 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 scheduleserviceModule 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.ScheduleServiceClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = scheduleserviceModule.v1beta1.ScheduleServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = scheduleserviceModule.v1beta1.ScheduleServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = scheduleserviceModule.v1beta1.ScheduleServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.scheduleServiceStub, undefined); - await client.initialize(); - assert(client.scheduleServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.scheduleServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.scheduleServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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('createSchedule', () => { - it('invokes createSchedule without error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.CreateScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CreateScheduleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.Schedule() - ); - client.innerApiCalls.createSchedule = stubSimpleCall(expectedResponse); - const [response] = await client.createSchedule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSchedule without error using callback', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.CreateScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CreateScheduleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.Schedule() - ); - client.innerApiCalls.createSchedule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSchedule( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ISchedule|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSchedule with error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.CreateScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CreateScheduleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSchedule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createSchedule(request), expectedError); - const actualRequest = (client.innerApiCalls.createSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSchedule with closed client', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.CreateScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.CreateScheduleRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createSchedule(request), expectedError); - }); - }); - - describe('getSchedule', () => { - it('invokes getSchedule without error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.GetScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.Schedule() - ); - client.innerApiCalls.getSchedule = stubSimpleCall(expectedResponse); - const [response] = await client.getSchedule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSchedule without error using callback', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.GetScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.Schedule() - ); - client.innerApiCalls.getSchedule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSchedule( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ISchedule|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSchedule with error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.GetScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSchedule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSchedule(request), expectedError); - const actualRequest = (client.innerApiCalls.getSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSchedule with closed client', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.GetScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.GetScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getSchedule(request), expectedError); - }); - }); - - describe('pauseSchedule', () => { - it('invokes pauseSchedule without error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.PauseScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.PauseScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.pauseSchedule = stubSimpleCall(expectedResponse); - const [response] = await client.pauseSchedule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.pauseSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pauseSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pauseSchedule without error using callback', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.PauseScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.PauseScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.pauseSchedule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.pauseSchedule( - 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.pauseSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pauseSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pauseSchedule with error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.PauseScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.PauseScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.pauseSchedule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.pauseSchedule(request), expectedError); - const actualRequest = (client.innerApiCalls.pauseSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pauseSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pauseSchedule with closed client', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.PauseScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.PauseScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.pauseSchedule(request), expectedError); - }); - }); - - describe('resumeSchedule', () => { - it('invokes resumeSchedule without error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.resumeSchedule = stubSimpleCall(expectedResponse); - const [response] = await client.resumeSchedule(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.resumeSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resumeSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resumeSchedule without error using callback', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.resumeSchedule = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.resumeSchedule( - 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.resumeSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resumeSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resumeSchedule with error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.resumeSchedule = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.resumeSchedule(request), expectedError); - const actualRequest = (client.innerApiCalls.resumeSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resumeSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resumeSchedule with closed client', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.resumeSchedule(request), expectedError); - }); - }); - - describe('deleteSchedule', () => { - it('invokes deleteSchedule without error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.DeleteScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteSchedule = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteSchedule(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSchedule without error using callback', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.DeleteScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteSchedule = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteSchedule( - request, - (err?: Error|null, - result?: 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.deleteSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSchedule with call error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.DeleteScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSchedule = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteSchedule(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSchedule with LRO error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.DeleteScheduleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.DeleteScheduleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSchedule = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteSchedule(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteSchedule as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSchedule as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteScheduleProgress without error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteScheduleProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteScheduleProgress with error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteScheduleProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listSchedules', () => { - it('invokes listSchedules without error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListSchedulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListSchedulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), - ]; - client.innerApiCalls.listSchedules = stubSimpleCall(expectedResponse); - const [response] = await client.listSchedules(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSchedules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSchedules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSchedules without error using callback', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListSchedulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListSchedulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), - ]; - client.innerApiCalls.listSchedules = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSchedules( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ISchedule[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSchedules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSchedules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSchedules with error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListSchedulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListSchedulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSchedules = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSchedules(request), expectedError); - const actualRequest = (client.innerApiCalls.listSchedules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSchedules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSchedulesStream without error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListSchedulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListSchedulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), - ]; - client.descriptors.page.listSchedules.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSchedulesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Schedule[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Schedule) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listSchedules.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSchedules, request)); - assert( - (client.descriptors.page.listSchedules.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSchedulesStream with error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListSchedulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListSchedulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSchedules.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSchedulesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Schedule[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Schedule) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSchedules.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSchedules, request)); - assert( - (client.descriptors.page.listSchedules.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSchedules without error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListSchedulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListSchedulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Schedule()), - ]; - client.descriptors.page.listSchedules.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.ISchedule[] = []; - const iterable = client.listSchedulesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSchedules.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSchedules.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSchedules with error', async () => { - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListSchedulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ListSchedulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSchedules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSchedulesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.ISchedule[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSchedules.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSchedules.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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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/google-cloud-aiplatform/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts deleted file mode 100644 index 9c616ee5722..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts +++ /dev/null @@ -1,3710 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_tensorboard_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_tensorboard_service_v1beta1.ts deleted file mode 100644 index 531e60c968f..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_tensorboard_service_v1beta1.ts +++ /dev/null @@ -1,7031 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('readTensorboardUsage', () => { - it('invokes readTensorboardUsage 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.ReadTensorboardUsageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ReadTensorboardUsageRequest', ['tensorboard']); - request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardUsageResponse() - ); - client.innerApiCalls.readTensorboardUsage = stubSimpleCall(expectedResponse); - const [response] = await client.readTensorboardUsage(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.readTensorboardUsage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardUsage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes readTensorboardUsage 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.ReadTensorboardUsageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ReadTensorboardUsageRequest', ['tensorboard']); - request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardUsageResponse() - ); - client.innerApiCalls.readTensorboardUsage = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.readTensorboardUsage( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardUsageResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.readTensorboardUsage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardUsage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes readTensorboardUsage 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.ReadTensorboardUsageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ReadTensorboardUsageRequest', ['tensorboard']); - request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.readTensorboardUsage = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.readTensorboardUsage(request), expectedError); - const actualRequest = (client.innerApiCalls.readTensorboardUsage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardUsage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes readTensorboardUsage 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.ReadTensorboardUsageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.aiplatform.v1beta1.ReadTensorboardUsageRequest', ['tensorboard']); - request.tensorboard = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.readTensorboardUsage(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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/test/gapic_vizier_service_v1beta1.ts b/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_vizier_service_v1beta1.ts deleted file mode 100644 index 92fba5f6c6b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/v1beta1/test/gapic_vizier_service_v1beta1.ts +++ /dev/null @@ -1,4877 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('.google.cloud.aiplatform.v1beta1.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('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('nasJob', () => { - const fakePath = "/rendered/path/nasJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasJobPath', () => { - const result = client.nasJobPath("projectValue", "locationValue", "nasJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasJobName', () => { - const result = client.matchProjectFromNasJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasJobName', () => { - const result = client.matchLocationFromNasJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasJobName', () => { - const result = client.matchNasJobFromNasJobName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nasTrialDetail', () => { - const fakePath = "/rendered/path/nasTrialDetail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - nas_job: "nasJobValue", - nas_trial_detail: "nasTrialDetailValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.nasTrialDetailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nasTrialDetailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nasTrialDetailPath', () => { - const result = client.nasTrialDetailPath("projectValue", "locationValue", "nasJobValue", "nasTrialDetailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNasTrialDetailName', () => { - const result = client.matchProjectFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNasTrialDetailName', () => { - const result = client.matchLocationFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasJobFromNasTrialDetailName', () => { - const result = client.matchNasJobFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasJobValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNasTrialDetailFromNasTrialDetailName', () => { - const result = client.matchNasTrialDetailFromNasTrialDetailName(fakePath); - assert.strictEqual(result, "nasTrialDetailValue"); - assert((client.pathTemplates.nasTrialDetailPathTemplate.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('projectLocationEndpoint', () => { - const fakePath = "/rendered/path/projectLocationEndpoint"; - 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.projectLocationEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationEndpointPath', () => { - const result = client.projectLocationEndpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationEndpointName', () => { - const result = client.matchProjectFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationEndpointName', () => { - const result = client.matchLocationFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromProjectLocationEndpointName', () => { - const result = client.matchEndpointFromProjectLocationEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.projectLocationEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationPublisherModel', () => { - const fakePath = "/rendered/path/projectLocationPublisherModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - publisher: "publisherValue", - model: "modelValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationPublisherModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationPublisherModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationPublisherModelPath', () => { - const result = client.projectLocationPublisherModelPath("projectValue", "locationValue", "publisherValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationPublisherModelName', () => { - const result = client.matchProjectFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationPublisherModelName', () => { - const result = client.matchLocationFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPublisherFromProjectLocationPublisherModelName', () => { - const result = client.matchPublisherFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "publisherValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromProjectLocationPublisherModelName', () => { - const result = client.matchModelFromProjectLocationPublisherModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.projectLocationPublisherModelPathTemplate.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('schedule', () => { - const fakePath = "/rendered/path/schedule"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - schedule: "scheduleValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schedulePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schedulePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schedulePath', () => { - const result = client.schedulePath("projectValue", "locationValue", "scheduleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schedulePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromScheduleName', () => { - const result = client.matchProjectFromScheduleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromScheduleName', () => { - const result = client.matchLocationFromScheduleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.schedulePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchScheduleFromScheduleName', () => { - const result = client.matchScheduleFromScheduleName(fakePath); - assert.strictEqual(result, "scheduleValue"); - assert((client.pathTemplates.schedulePathTemplate.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/google-cloud-aiplatform/v1beta1/tsconfig.json b/owl-bot-staging/google-cloud-aiplatform/v1beta1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/google-cloud-aiplatform/v1beta1/webpack.config.js b/owl-bot-staging/google-cloud-aiplatform/v1beta1/webpack.config.js deleted file mode 100644 index f4947d41e6b..00000000000 --- a/owl-bot-staging/google-cloud-aiplatform/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/packages/google-cloud-aiplatform/README.md b/packages/google-cloud-aiplatform/README.md index fc3bb0ae2af..23cf0bf6309 100644 --- a/packages/google-cloud-aiplatform/README.md +++ b/packages/google-cloud-aiplatform/README.md @@ -119,6 +119,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Endpoint_service.deploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.deploy_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.deploy_model.js,samples/README.md) | | Endpoint_service.get_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.get_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.get_endpoint.js,samples/README.md) | | Endpoint_service.list_endpoints | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.list_endpoints.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.list_endpoints.js,samples/README.md) | +| Endpoint_service.mutate_deployed_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.mutate_deployed_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.mutate_deployed_model.js,samples/README.md) | | Endpoint_service.undeploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.undeploy_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.undeploy_model.js,samples/README.md) | | Endpoint_service.update_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.update_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.update_endpoint.js,samples/README.md) | | Featurestore_online_serving_service.read_feature_values | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_online_serving_service.read_feature_values.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/featurestore_online_serving_service.read_feature_values.js,samples/README.md) | @@ -330,6 +331,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Endpoint_service.deploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.deploy_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.deploy_model.js,samples/README.md) | | Endpoint_service.get_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.get_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.get_endpoint.js,samples/README.md) | | Endpoint_service.list_endpoints | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.list_endpoints.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.list_endpoints.js,samples/README.md) | +| Endpoint_service.mutate_deployed_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js,samples/README.md) | | Endpoint_service.undeploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.undeploy_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.undeploy_model.js,samples/README.md) | | Endpoint_service.update_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.update_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.update_endpoint.js,samples/README.md) | | Featurestore_online_serving_service.read_feature_values | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.read_feature_values.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.read_feature_values.js,samples/README.md) | diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/accelerator_type.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/accelerator_type.proto index 7e5f31075ad..f06cfb9df9e 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/accelerator_type.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/accelerator_type.proto @@ -47,6 +47,9 @@ enum AcceleratorType { // Nvidia Tesla A100 GPU. NVIDIA_TESLA_A100 = 8; + // Nvidia L4 GPU. + NVIDIA_L4 = 11; + // TPU v2. TPU_V2 = 6; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto index 8791eedb38d..5388cd02886 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto @@ -446,9 +446,9 @@ message BatchPredictionJob { // 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, + // Cloud Logging by default. Please note that the logs incur cost, // which are subject to [Cloud Logging - // pricing](https://cloud.google.com/stackdriver/pricing). + // pricing](https://cloud.google.com/logging/pricing). // // User can disable container logging by setting this flag to true. bool disable_container_logging = 34; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/custom_job.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/custom_job.proto index 3f8aba92a5f..10be55ef321 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/custom_job.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/custom_job.proto @@ -216,6 +216,26 @@ message CustomJobSpec { // (within // [HyperparameterTuningJob.trials][google.cloud.aiplatform.v1.HyperparameterTuningJob.trials]). bool enable_dashboard_access = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Experiment associated with this job. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadataStores}/contexts/{experiment-name}` + string experiment = 17 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; + + // Optional. The Experiment Run associated with this job. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadataStores}/contexts/{experiment-name}-{experiment-run-name}` + string experiment_run = 18 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; } // Represents the spec of a worker pool in a job. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/dataset.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/dataset.proto index c0daef00bb5..bca97b5b9d0 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/dataset.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/dataset.proto @@ -90,7 +90,7 @@ message Dataset { map labels = 7; // All SavedQueries belong to the Dataset will be returned in List/Get - // Dataset response. The [annotation_specs][SavedQuery.annotation_specs] field + // Dataset response. The annotation_specs field // will not be populated except for UI cases which will only use // [annotation_spec_count][google.cloud.aiplatform.v1.SavedQuery.annotation_spec_count]. // In CreateDataset request, a SavedQuery is created together if @@ -176,9 +176,9 @@ message ExportDataConfig { ExportFractionSplit fraction_split = 5; } - // 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 + // An expression for filtering what part of the Dataset is to be exported. + // Only Annotations 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/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/endpoint.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/endpoint.proto index 8c918c3733d..e014e10611f 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/endpoint.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/endpoint.proto @@ -38,6 +38,7 @@ message Endpoint { option (google.api.resource) = { type: "aiplatform.googleapis.com/Endpoint" pattern: "projects/{project}/locations/{location}/endpoints/{endpoint}" + pattern: "projects/{project}/locations/{location}/publishers/{publisher}/models/{model}" }; // Output only. The resource name of the Endpoint. @@ -127,7 +128,8 @@ message Endpoint { // Output only. Resource name of the Model Monitoring job associated with this // Endpoint if monitoring is enabled by - // [CreateModelDeploymentMonitoringJob][]. Format: + // [JobService.CreateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.CreateModelDeploymentMonitoringJob]. + // Format: // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` string model_deployment_monitoring_job = 14 [ (google.api.field_behavior) = OUTPUT_ONLY, @@ -223,19 +225,19 @@ message DeployedModel { // 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, + // Cloud Logging by default. Please note that the logs incur cost, // which are subject to [Cloud Logging - // pricing](https://cloud.google.com/stackdriver/pricing). + // pricing](https://cloud.google.com/logging/pricing). // // User can disable container logging by setting this flag to true. bool disable_container_logging = 15; - // If true, online prediction access logs are sent to StackDriver + // If true, online prediction access logs are sent to Cloud // Logging. // 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 + // Note that 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; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/endpoint_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/endpoint_service.proto index 2bdf828d37f..6ac193dabf8 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/endpoint_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/endpoint_service.proto @@ -122,6 +122,24 @@ service EndpointService { metadata_type: "UndeployModelOperationMetadata" }; } + + // Updates an existing deployed model. Updatable fields include + // `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, + // `disable_container_logging` (v1 only), and `enable_container_logging` + // (v1beta1 only). + rpc MutateDeployedModel(MutateDeployedModelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:mutateDeployedModel" + body: "*" + }; + option (google.api.method_signature) = + "endpoint,deployed_model,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "MutateDeployedModelResponse" + metadata_type: "MutateDeployedModelOperationMetadata" + }; + } } // Request message for @@ -358,3 +376,50 @@ message UndeployModelOperationMetadata { // The operation generic information. GenericOperationMetadata generic_metadata = 1; } + +// Request message for +// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1.EndpointService.MutateDeployedModel]. +message MutateDeployedModelRequest { + // Required. The name of the Endpoint resource into which to mutate a + // DeployedModel. 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 mutated within the Endpoint. Only the + // following fields can be mutated: + // + // * `min_replica_count` in either + // [DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources] or + // [AutomaticResources][google.cloud.aiplatform.v1.AutomaticResources] + // * `max_replica_count` in either + // [DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources] or + // [AutomaticResources][google.cloud.aiplatform.v1.AutomaticResources] + // * [autoscaling_metric_specs][google.cloud.aiplatform.v1.DedicatedResources.autoscaling_metric_specs] + // * `disable_container_logging` (v1 only) + // * `enable_container_logging` (v1beta1 only) + DeployedModel deployed_model = 2 [(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 = 4 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for +// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1.EndpointService.MutateDeployedModel]. +message MutateDeployedModelResponse { + // The DeployedModel that's being mutated. + DeployedModel deployed_model = 1; +} + +// Runtime operation information for +// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1.EndpointService.MutateDeployedModel]. +message MutateDeployedModelOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/entity_type.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/entity_type.proto index 72e3e3784e2..8e70ea2a37f 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/entity_type.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/entity_type.proto @@ -88,4 +88,11 @@ message EntityType { // disabled. FeaturestoreMonitoringConfig monitoring_config = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Config for data retention policy in offline storage. + // TTL in days for feature values that will be stored in offline storage. + // The Feature Store offline storage periodically removes obsolete feature + // values older than `offline_storage_ttl_days` since the feature generation + // time. If unset (or explicitly set to 0), default to 4000 days TTL. + int32 offline_storage_ttl_days = 10 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/evaluated_annotation.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/evaluated_annotation.proto index d4430e56011..2d74effd981 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/evaluated_annotation.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/evaluated_annotation.proto @@ -103,10 +103,6 @@ message EvaluatedAnnotation { // ModelEvaluation. The EvaluatedDataItemView consists of all ground truths // and predictions on // [data_item_payload][google.cloud.aiplatform.v1.EvaluatedAnnotation.data_item_payload]. - // - // Can be passed in - // [GetEvaluatedDataItemView's][ModelService.GetEvaluatedDataItemView][] - // [id][GetEvaluatedDataItemViewRequest.id]. string evaluated_data_item_view_id = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/explanation.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/explanation.proto index 6efe5a9ebf3..c1e3545c9c4 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/explanation.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/explanation.proto @@ -420,8 +420,8 @@ message BlurBaselineConfig { // 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. + // attribution 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. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/feature.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/feature.proto index 544b9ebe883..327ec57d301 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/feature.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/feature.proto @@ -38,10 +38,11 @@ message 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 + // A list of historical + // [SnapshotAnalysis][google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.SnapshotAnalysis] + // or + // [ImportFeaturesAnalysis][google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.ImportFeaturesAnalysis] + // stats requested by user, sorted by // [FeatureStatsAnomaly.start_time][google.cloud.aiplatform.v1.FeatureStatsAnomaly.start_time] // descending. message MonitoringStatsAnomaly { diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/featurestore.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/featurestore.proto index 2df135ab1e8..bcaf8ac3e91 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/featurestore.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/featurestore.proto @@ -138,6 +138,14 @@ message Featurestore { // Output only. State of the featurestore. State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. TTL in days for feature values that will be stored in online + // serving storage. The Feature Store online storage periodically removes + // obsolete feature values older than `online_storage_ttl_days` since the + // feature generation time. Note that `online_storage_ttl_days` should be less + // than or equal to `offline_storage_ttl_days` for each EntityType under a + // featurestore. If not set, default to 4000 days + int32 online_storage_ttl_days = 13 [(google.api.field_behavior) = OPTIONAL]; + // 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/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto index 613fc7b7320..6cc4e677546 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto @@ -162,7 +162,7 @@ message ReadFeatureValuesResponse { }]; // List of Feature metadata corresponding to each piece of - // [ReadFeatureValuesResponse.data][]. + // [ReadFeatureValuesResponse.EntityView.data][google.cloud.aiplatform.v1.ReadFeatureValuesResponse.EntityView.data]. repeated FeatureDescriptor feature_descriptors = 2; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/featurestore_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/featurestore_service.proto index 8394b21a6c0..9249e3874ac 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/featurestore_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/featurestore_service.proto @@ -464,7 +464,7 @@ message UpdateFeaturestoreRequest { // * `labels` // * `online_serving_config.fixed_node_count` // * `online_serving_config.scaling` - // * `online_storage_ttl_days` (available in Preview) + // * `online_storage_ttl_days` google.protobuf.FieldMask update_mask = 2; } @@ -927,7 +927,7 @@ message UpdateEntityTypeRequest { // * `monitoring_config.import_features_analysis.anomaly_detection_baseline` // * `monitoring_config.numerical_threshold_config.value` // * `monitoring_config.categorical_threshold_config.value` - // * `offline_storage_ttl_days` (available in Preview) + // * `offline_storage_ttl_days` google.protobuf.FieldMask update_mask = 2; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/index_endpoint.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/index_endpoint.proto index f49cd495d24..9b4dd453297 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/index_endpoint.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/index_endpoint.proto @@ -204,13 +204,13 @@ message DeployedIndex { DedicatedResources dedicated_resources = 16 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If true, private endpoint's access logs are sent to StackDriver + // Optional. If true, private endpoint's access logs are sent to Cloud // 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 + // Note that 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]; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto index 7b8c5ccf924..4872249c54a 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto @@ -700,6 +700,9 @@ message ModelSourceInfo { // The Model is saved or tuned from Model Garden. MODEL_GARDEN = 4; + + // The Model is saved or tuned from Genie. + GENIE = 5; } // Type of the model source. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_monitoring.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_monitoring.proto index 2749cfe884c..1978accfb37 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_monitoring.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_monitoring.proto @@ -26,6 +26,10 @@ 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"; +option (google.api.resource_definition) = { + type: "monitoring.googleapis.com/NotificationChannel" + pattern: "projects/{project}/notificationChannels/{notification_channel}" +}; // The objective configuration for model monitoring, including the information // needed to detect anomalies for one particular model. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_service.proto index b878e065bc7..3ab66e345c0 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_service.proto @@ -406,8 +406,10 @@ message ListModelVersionsRequest { // 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. + // [next_page_token][google.cloud.aiplatform.v1.ListModelVersionsResponse.next_page_token] + // of the previous + // [ListModelVersions][google.cloud.aiplatform.v1.ModelService.ListModelVersions] + // call. string page_token = 3; // An expression for filtering the results of the request. For field names diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/pipeline_job.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/pipeline_job.proto index 9cae7212105..fbad9ec38c5 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/pipeline_job.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/pipeline_job.proto @@ -293,7 +293,7 @@ message PipelineTaskDetail { 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][]. + // [pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec]. string task_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Task create time. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/prediction_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/prediction_service.proto index a976ad8d586..16463dd48c5 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/prediction_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/prediction_service.proto @@ -43,6 +43,10 @@ service PredictionService { option (google.api.http) = { post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:predict" body: "*" + additional_bindings { + post: "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:predict" + body: "*" + } }; option (google.api.method_signature) = "endpoint,instances,parameters"; } @@ -62,6 +66,10 @@ service PredictionService { option (google.api.http) = { post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:rawPredict" body: "*" + additional_bindings { + post: "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:rawPredict" + body: "*" + } }; option (google.api.method_signature) = "endpoint,http_body"; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto index 51aa1fb528a..6ae26d3efad 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto @@ -57,18 +57,20 @@ message TensorboardExperiment { // The labels with user-defined metadata to organize your Datasets. // - // Label keys and values can be no longer than 64 characters + // Label keys and values cannot be 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. + // System reserved label keys are prefixed with `aiplatform.googleapis.com/` + // and are immutable. The 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 = 6; // Used to perform consistent read-modify-write updates. If not set, a blind diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tensorboard_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tensorboard_service.proto index 1eaed5063c7..979f5aae94f 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tensorboard_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tensorboard_service.proto @@ -1093,12 +1093,12 @@ message ExportTensorboardTimeSeriesDataRequest { int32 page_size = 3; // A page token, received from a previous - // [TensorboardService.ExportTensorboardTimeSeries][] call. - // Provide this to retrieve the subsequent page. + // [ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData] + // 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. + // [ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData] + // must match the call that provided the page token. string page_token = 4; // Field to use to sort the TensorboardTimeSeries' data. @@ -1114,8 +1114,9 @@ message ExportTensorboardTimeSeriesDataResponse { 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. + // [page_token][google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest.page_token] + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. string next_page_token = 2; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto index 92c9b50f345..4e7bf4657eb 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto @@ -47,9 +47,12 @@ enum AcceleratorType { // Nvidia Tesla A100 GPU. NVIDIA_TESLA_A100 = 8; - // Nvidia A2 Ultra GPU. + // Nvidia A100 80GB GPU. NVIDIA_A100_80GB = 9; + // Nvidia L4 GPU. + NVIDIA_L4 = 11; + // TPU v2. TPU_V2 = 6; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto index 5a98131589b..30e149e6a23 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto @@ -463,9 +463,9 @@ message BatchPredictionJob { // 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, + // Cloud Logging by default. Please note that the logs incur cost, // which are subject to [Cloud Logging - // pricing](https://cloud.google.com/stackdriver/pricing). + // pricing](https://cloud.google.com/logging/pricing). // // User can disable container logging by setting this flag to true. bool disable_container_logging = 34; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/custom_job.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/custom_job.proto index dc41de428b9..ea44a6b0c5b 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/custom_job.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/custom_job.proto @@ -216,6 +216,26 @@ message CustomJobSpec { // (within // [HyperparameterTuningJob.trials][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.trials]). bool enable_dashboard_access = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Experiment associated with this job. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadataStores}/contexts/{experiment-name}` + string experiment = 17 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; + + // Optional. The Experiment Run associated with this job. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadataStores}/contexts/{experiment-name}-{experiment-run-name}` + string experiment_run = 18 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; } // Represents the spec of a worker pool in a job. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/dataset.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/dataset.proto index 1ae48018638..3e293382e06 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/dataset.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/dataset.proto @@ -90,7 +90,7 @@ message Dataset { map labels = 7; // All SavedQueries belong to the Dataset will be returned in List/Get - // Dataset response. The [annotation_specs][SavedQuery.annotation_specs] field + // Dataset response. The annotation_specs field // will not be populated except for UI cases which will only use // [annotation_spec_count][google.cloud.aiplatform.v1beta1.SavedQuery.annotation_spec_count]. // In CreateDataset request, a SavedQuery is created together if @@ -177,9 +177,9 @@ message ExportDataConfig { ExportFractionSplit fraction_split = 5; } - // 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 + // An expression for filtering what part of the Dataset is to be exported. + // Only Annotations 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/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/endpoint.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/endpoint.proto index 6d1c9aef19d..7b787eb9efb 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/endpoint.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/endpoint.proto @@ -38,6 +38,7 @@ message Endpoint { option (google.api.resource) = { type: "aiplatform.googleapis.com/Endpoint" pattern: "projects/{project}/locations/{location}/endpoints/{endpoint}" + pattern: "projects/{project}/locations/{location}/publishers/{publisher}/models/{model}" }; // Output only. The resource name of the Endpoint. @@ -127,7 +128,8 @@ message Endpoint { // Output only. Resource name of the Model Monitoring job associated with this // Endpoint if monitoring is enabled by - // [CreateModelDeploymentMonitoringJob][]. Format: + // [JobService.CreateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.CreateModelDeploymentMonitoringJob]. + // Format: // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` string model_deployment_monitoring_job = 14 [ (google.api.field_behavior) = OUTPUT_ONLY, @@ -236,17 +238,17 @@ message DeployedModel { string service_account = 11; // If true, the container of the DeployedModel instances will send `stderr` - // and `stdout` streams to Stackdriver Logging. + // and `stdout` streams to Cloud Logging. // // Only supported for custom-trained Models and AutoML Tabular Models. bool enable_container_logging = 12; - // If true, online prediction access logs are sent to StackDriver + // If true, online prediction access logs are sent to Cloud // Logging. // 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 + // Note that 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; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto index fdf008eb827..f0ed6f97940 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto @@ -122,6 +122,24 @@ service EndpointService { metadata_type: "UndeployModelOperationMetadata" }; } + + // Updates an existing deployed model. Updatable fields include + // `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, + // `disable_container_logging` (v1 only), and `enable_container_logging` + // (v1beta1 only). + rpc MutateDeployedModel(MutateDeployedModelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:mutateDeployedModel" + body: "*" + }; + option (google.api.method_signature) = + "endpoint,deployed_model,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "MutateDeployedModelResponse" + metadata_type: "MutateDeployedModelOperationMetadata" + }; + } } // Request message for @@ -348,3 +366,50 @@ message UndeployModelOperationMetadata { // The operation generic information. GenericOperationMetadata generic_metadata = 1; } + +// Request message for +// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModel]. +message MutateDeployedModelRequest { + // Required. The name of the Endpoint resource into which to mutate a + // DeployedModel. 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 mutated within the Endpoint. Only the + // following fields can be mutated: + // + // * `min_replica_count` in either + // [DedicatedResources][google.cloud.aiplatform.v1beta1.DedicatedResources] or + // [AutomaticResources][google.cloud.aiplatform.v1beta1.AutomaticResources] + // * `max_replica_count` in either + // [DedicatedResources][google.cloud.aiplatform.v1beta1.DedicatedResources] or + // [AutomaticResources][google.cloud.aiplatform.v1beta1.AutomaticResources] + // * [autoscaling_metric_specs][google.cloud.aiplatform.v1beta1.DedicatedResources.autoscaling_metric_specs] + // * `disable_container_logging` (v1 only) + // * `enable_container_logging` (v1beta1 only) + DeployedModel deployed_model = 2 [(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 = 4 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for +// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModel]. +message MutateDeployedModelResponse { + // The DeployedModel that's being mutated. + DeployedModel deployed_model = 1; +} + +// Runtime operation information for +// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModel]. +message MutateDeployedModelOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto index 6e68912c0f4..239b55cdb6b 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto @@ -103,10 +103,6 @@ message EvaluatedAnnotation { // ModelEvaluation. The EvaluatedDataItemView consists of all ground truths // and predictions on // [data_item_payload][google.cloud.aiplatform.v1beta1.EvaluatedAnnotation.data_item_payload]. - // - // Can be passed in - // [GetEvaluatedDataItemView's][ModelService.GetEvaluatedDataItemView][] - // [id][GetEvaluatedDataItemViewRequest.id]. string evaluated_data_item_view_id = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/explanation.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/explanation.proto index 29ee96a7b94..6a0e8bfab31 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/explanation.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/explanation.proto @@ -426,20 +426,22 @@ message BlurBaselineConfig { // 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. + // The full configuration for the generated index, the semantics are the + // same as [metadata][google.cloud.aiplatform.v1beta1.Index.metadata] and + // should match + // [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config). google.protobuf.Value nearest_neighbor_search_config = 2; - // Preset config based on the desired query speed-precision trade-off - // and modality + // Simplified preset configuration, which automatically sets configuration + // values based on the desired query speed-precision trade-off and modality. Presets presets = 4; } - // The Cloud Storage location for the input instances. + // The Cloud Storage locations that contain the instances to be + // indexed for approximate nearest neighbor search. GcsSource gcs_source = 1; - // The number of neighbors to return. + // The number of neighbors to return when querying for examples. int32 neighbor_count = 3; } @@ -448,7 +450,6 @@ 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. @@ -470,10 +471,14 @@ message Presets { TABULAR = 3; } - // Preset option controlling parameters for query speed-precision trade-off + // Preset option controlling parameters for speed-precision trade-off when + // querying for examples. If omitted, defaults to `PRECISE`. optional Query query = 1; - // Preset option controlling parameters for different modalities + // The modality of the uploaded model, which automatically configures the + // distance measurement and feature normalization for the underlying example + // index and queries. If your model does not precisely fit one of these types, + // it is okay to choose the closest type. Modality modality = 2; } @@ -482,8 +487,8 @@ message Presets { // 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. + // attribution 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. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/feature.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/feature.proto index 4ac111e5f72..c37b23c9ed8 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/feature.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/feature.proto @@ -39,10 +39,11 @@ message 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 + // A list of historical + // [SnapshotAnalysis][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis] + // or + // [ImportFeaturesAnalysis][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.ImportFeaturesAnalysis] + // stats requested by user, sorted by // [FeatureStatsAnomaly.start_time][google.cloud.aiplatform.v1beta1.FeatureStatsAnomaly.start_time] // descending. message MonitoringStatsAnomaly { @@ -170,8 +171,8 @@ message Feature { // config on EntityType. bool disable_monitoring = 12 [(google.api.field_behavior) = OPTIONAL]; - // Output only. A list of historical [Snapshot - // Analysis][FeaturestoreMonitoringConfig.SnapshotAnalysis] + // Output only. A list of historical + // [SnapshotAnalysis][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis] // stats requested by user, sorted by // [FeatureStatsAnomaly.start_time][google.cloud.aiplatform.v1beta1.FeatureStatsAnomaly.start_time] // descending. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto index af6182b2d56..5c26efb6f16 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto @@ -162,7 +162,7 @@ message ReadFeatureValuesResponse { }]; // List of Feature metadata corresponding to each piece of - // [ReadFeatureValuesResponse.data][]. + // [ReadFeatureValuesResponse.EntityView.data][google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse.EntityView.data]. repeated FeatureDescriptor feature_descriptors = 2; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto index 5efd213643f..f4ec90768c2 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto @@ -464,7 +464,7 @@ message UpdateFeaturestoreRequest { // * `labels` // * `online_serving_config.fixed_node_count` // * `online_serving_config.scaling` - // * `online_storage_ttl_days` (available in Preview) + // * `online_storage_ttl_days` google.protobuf.FieldMask update_mask = 2; } @@ -927,7 +927,7 @@ message UpdateEntityTypeRequest { // * `monitoring_config.import_features_analysis.anomaly_detection_baseline` // * `monitoring_config.numerical_threshold_config.value` // * `monitoring_config.categorical_threshold_config.value` - // * `offline_storage_ttl_days` (available in Preview) + // * `offline_storage_ttl_days` google.protobuf.FieldMask update_mask = 2; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto index 9d1c55ec7be..ef2efb41c65 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto @@ -205,13 +205,13 @@ message DeployedIndex { DedicatedResources dedicated_resources = 16 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If true, private endpoint's access logs are sent to StackDriver + // Optional. If true, private endpoint's access logs are sent to Cloud // 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 + // Note that 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]; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/match_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/match_service.proto index 07acb17b08f..88f1ba11b45 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/match_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/match_service.proto @@ -102,7 +102,7 @@ message FindNeighborsRequest { } ]; - // The ID of the DeploydIndex that will serve the request. This request is + // The ID of the DeployedIndex that will serve the request. This request is // sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That // IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index // has a DeployedIndex.id field. @@ -161,7 +161,7 @@ message ReadIndexDatapointsRequest { } ]; - // The ID of the DeploydIndex that will serve the request. + // The ID of the DeployedIndex that will serve the request. string deployed_index_id = 2; // IDs of the datapoints to be searched for. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto index 3dd24837ff2..6293bfa22f4 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto @@ -712,6 +712,9 @@ message ModelSourceInfo { // The Model is saved or tuned from Model Garden. MODEL_GARDEN = 4; + + // The Model is saved or tuned from Genie. + GENIE = 5; } // Type of the model source. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_service.proto index 5a766d0e834..49eaee8e2cb 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_service.proto @@ -410,8 +410,10 @@ message ListModelVersionsRequest { // 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. + // [next_page_token][google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token] + // of the previous + // [ListModelVersions][google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions] + // call. string page_token = 3; // An expression for filtering the results of the request. For field names diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto index 8878c8bdfbf..75171c649f2 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto @@ -293,7 +293,7 @@ message PipelineTaskDetail { 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][]. + // [pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_spec]. string task_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Task create time. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto index 2a07c70d22b..b6d2c16ffb8 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto @@ -43,6 +43,10 @@ service PredictionService { option (google.api.http) = { post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:predict" body: "*" + additional_bindings { + post: "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:predict" + body: "*" + } }; option (google.api.method_signature) = "endpoint,instances,parameters"; } @@ -62,6 +66,10 @@ service PredictionService { option (google.api.http) = { post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:rawPredict" body: "*" + additional_bindings { + post: "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:rawPredict" + body: "*" + } }; option (google.api.method_signature) = "endpoint,http_body"; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/schedule.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/schedule.proto index 14113392316..ad02ad01d2b 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/schedule.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/schedule.proto @@ -37,6 +37,15 @@ message Schedule { pattern: "projects/{project}/locations/{location}/schedules/{schedule}" }; + // Status of a scheduled run. + message RunResponse { + // The scheduled run time based on the user-specified schedule. + google.protobuf.Timestamp scheduled_run_time = 1; + + // The response of the scheduled run. + string run_response = 2; + } + // Possible state of the schedule. enum State { // Unspecified. @@ -119,6 +128,10 @@ message Schedule { google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Timestamp when this Schedule was updated. + google.protobuf.Timestamp update_time = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Timestamp when this Schedule should schedule the next run. // Having a next_run_time in the past means the runs are being started // behind schedule. @@ -135,8 +148,9 @@ message Schedule { google.protobuf.Timestamp last_resume_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Required. Maximum number of runs that can be executed concurrently for this - // Schedule. + // Required. Maximum number of runs that can be started concurrently for this + // Schedule. This is the limit for starting the scheduled requests and not the + // execution of the operations/jobs created by the requests (if applicable). int64 max_concurrent_run_count = 11 [(google.api.field_behavior) = REQUIRED]; // Optional. Whether new scheduled runs can be queued when max_concurrent_runs @@ -148,4 +162,11 @@ message Schedule { // from PAUSED state. If set to true, all missed runs will be scheduled. New // runs will be scheduled after the backfill is complete. Default to false. bool catch_up = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Response of the last scheduled run. + // This is the response for starting the scheduled requests and not the + // execution of the operations/jobs created by the requests (if applicable). + // Unset if no run has been scheduled yet. + RunResponse last_scheduled_run_response = 18 + [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/schedule_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/schedule_service.proto index 74bebf386ca..234dcece3c2 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/schedule_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/schedule_service.proto @@ -104,6 +104,7 @@ service ScheduleService { body: "*" }; option (google.api.method_signature) = "name"; + option (google.api.method_signature) = "name,catch_up"; } } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto index b9801bf6452..c29f2f17b6a 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto @@ -57,18 +57,20 @@ message TensorboardExperiment { // The labels with user-defined metadata to organize your Datasets. // - // Label keys and values can be no longer than 64 characters + // Label keys and values cannot be 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. + // System reserved label keys are prefixed with `aiplatform.googleapis.com/` + // and are immutable. The 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 = 6; // Used to perform consistent read-modify-write updates. If not set, a blind diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto index 0332db5dd4a..df9799cc9c5 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto @@ -1092,12 +1092,12 @@ message ExportTensorboardTimeSeriesDataRequest { int32 page_size = 3; // A page token, received from a previous - // [TensorboardService.ExportTensorboardTimeSeries][] call. - // Provide this to retrieve the subsequent page. + // [ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData] + // 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. + // [ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData] + // must match the call that provided the page token. string page_token = 4; // Field to use to sort the TensorboardTimeSeries' data. @@ -1113,8 +1113,9 @@ message ExportTensorboardTimeSeriesDataResponse { 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. + // [page_token][google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest.page_token] + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. string next_page_token = 2; } diff --git a/packages/google-cloud-aiplatform/protos/protos.d.ts b/packages/google-cloud-aiplatform/protos/protos.d.ts index a92e547e72c..53622c5f8cf 100644 --- a/packages/google-cloud-aiplatform/protos/protos.d.ts +++ b/packages/google-cloud-aiplatform/protos/protos.d.ts @@ -35,6 +35,7 @@ export namespace google { NVIDIA_TESLA_P4 = 4, NVIDIA_TESLA_T4 = 5, NVIDIA_TESLA_A100 = 8, + NVIDIA_L4 = 11, TPU_V2 = 6, TPU_V3 = 7, TPU_V4_POD = 10 @@ -6999,7 +7000,8 @@ export namespace google { AUTOML = 1, CUSTOM = 2, BQML = 3, - MODEL_GARDEN = 4 + MODEL_GARDEN = 4, + GENIE = 5 } } @@ -7558,6 +7560,12 @@ export namespace google { /** CustomJobSpec enableDashboardAccess */ enableDashboardAccess?: (boolean|null); + + /** CustomJobSpec experiment */ + experiment?: (string|null); + + /** CustomJobSpec experimentRun */ + experimentRun?: (string|null); } /** Represents a CustomJobSpec. */ @@ -7596,6 +7604,12 @@ export namespace google { /** CustomJobSpec enableDashboardAccess. */ public enableDashboardAccess: boolean; + /** CustomJobSpec experiment. */ + public experiment: string; + + /** CustomJobSpec experimentRun. */ + public experimentRun: string; + /** * Creates a new CustomJobSpec instance using the specified properties. * @param [properties] Properties to set @@ -13341,6 +13355,20 @@ export namespace google { * @returns Promise */ public undeployModel(request: google.cloud.aiplatform.v1.IUndeployModelRequest): Promise; + + /** + * Calls MutateDeployedModel. + * @param request MutateDeployedModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public mutateDeployedModel(request: google.cloud.aiplatform.v1.IMutateDeployedModelRequest, callback: google.cloud.aiplatform.v1.EndpointService.MutateDeployedModelCallback): void; + + /** + * Calls MutateDeployedModel. + * @param request MutateDeployedModelRequest message or plain object + * @returns Promise + */ + public mutateDeployedModel(request: google.cloud.aiplatform.v1.IMutateDeployedModelRequest): Promise; } namespace EndpointService { @@ -13393,6 +13421,13 @@ export namespace google { * @param [response] Operation */ type UndeployModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.EndpointService|mutateDeployedModel}. + * @param error Error, if any + * @param [response] Operation + */ + type MutateDeployedModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of a CreateEndpointRequest. */ @@ -14728,6 +14763,309 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a MutateDeployedModelRequest. */ + interface IMutateDeployedModelRequest { + + /** MutateDeployedModelRequest endpoint */ + endpoint?: (string|null); + + /** MutateDeployedModelRequest deployedModel */ + deployedModel?: (google.cloud.aiplatform.v1.IDeployedModel|null); + + /** MutateDeployedModelRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a MutateDeployedModelRequest. */ + class MutateDeployedModelRequest implements IMutateDeployedModelRequest { + + /** + * Constructs a new MutateDeployedModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IMutateDeployedModelRequest); + + /** MutateDeployedModelRequest endpoint. */ + public endpoint: string; + + /** MutateDeployedModelRequest deployedModel. */ + public deployedModel?: (google.cloud.aiplatform.v1.IDeployedModel|null); + + /** MutateDeployedModelRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new MutateDeployedModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateDeployedModelRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IMutateDeployedModelRequest): google.cloud.aiplatform.v1.MutateDeployedModelRequest; + + /** + * Encodes the specified MutateDeployedModelRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.MutateDeployedModelRequest.verify|verify} messages. + * @param message MutateDeployedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IMutateDeployedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateDeployedModelRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MutateDeployedModelRequest.verify|verify} messages. + * @param message MutateDeployedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IMutateDeployedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateDeployedModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateDeployedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.MutateDeployedModelRequest; + + /** + * Decodes a MutateDeployedModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateDeployedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.MutateDeployedModelRequest; + + /** + * Verifies a MutateDeployedModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateDeployedModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateDeployedModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.MutateDeployedModelRequest; + + /** + * Creates a plain object from a MutateDeployedModelRequest message. Also converts values to other types if specified. + * @param message MutateDeployedModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.MutateDeployedModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateDeployedModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateDeployedModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MutateDeployedModelResponse. */ + interface IMutateDeployedModelResponse { + + /** MutateDeployedModelResponse deployedModel */ + deployedModel?: (google.cloud.aiplatform.v1.IDeployedModel|null); + } + + /** Represents a MutateDeployedModelResponse. */ + class MutateDeployedModelResponse implements IMutateDeployedModelResponse { + + /** + * Constructs a new MutateDeployedModelResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IMutateDeployedModelResponse); + + /** MutateDeployedModelResponse deployedModel. */ + public deployedModel?: (google.cloud.aiplatform.v1.IDeployedModel|null); + + /** + * Creates a new MutateDeployedModelResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateDeployedModelResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IMutateDeployedModelResponse): google.cloud.aiplatform.v1.MutateDeployedModelResponse; + + /** + * Encodes the specified MutateDeployedModelResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.MutateDeployedModelResponse.verify|verify} messages. + * @param message MutateDeployedModelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IMutateDeployedModelResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateDeployedModelResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MutateDeployedModelResponse.verify|verify} messages. + * @param message MutateDeployedModelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IMutateDeployedModelResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateDeployedModelResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateDeployedModelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.MutateDeployedModelResponse; + + /** + * Decodes a MutateDeployedModelResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateDeployedModelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.MutateDeployedModelResponse; + + /** + * Verifies a MutateDeployedModelResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateDeployedModelResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateDeployedModelResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.MutateDeployedModelResponse; + + /** + * Creates a plain object from a MutateDeployedModelResponse message. Also converts values to other types if specified. + * @param message MutateDeployedModelResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.MutateDeployedModelResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateDeployedModelResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateDeployedModelResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MutateDeployedModelOperationMetadata. */ + interface IMutateDeployedModelOperationMetadata { + + /** MutateDeployedModelOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + } + + /** Represents a MutateDeployedModelOperationMetadata. */ + class MutateDeployedModelOperationMetadata implements IMutateDeployedModelOperationMetadata { + + /** + * Constructs a new MutateDeployedModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IMutateDeployedModelOperationMetadata); + + /** MutateDeployedModelOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + + /** + * Creates a new MutateDeployedModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateDeployedModelOperationMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IMutateDeployedModelOperationMetadata): google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata; + + /** + * Encodes the specified MutateDeployedModelOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata.verify|verify} messages. + * @param message MutateDeployedModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IMutateDeployedModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateDeployedModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata.verify|verify} messages. + * @param message MutateDeployedModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IMutateDeployedModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateDeployedModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateDeployedModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata; + + /** + * Decodes a MutateDeployedModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateDeployedModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata; + + /** + * Verifies a MutateDeployedModelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateDeployedModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateDeployedModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata; + + /** + * Creates a plain object from a MutateDeployedModelOperationMetadata message. Also converts values to other types if specified. + * @param message MutateDeployedModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateDeployedModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateDeployedModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an EntityType. */ interface IEntityType { @@ -14751,6 +15089,9 @@ export namespace google { /** EntityType monitoringConfig */ monitoringConfig?: (google.cloud.aiplatform.v1.IFeaturestoreMonitoringConfig|null); + + /** EntityType offlineStorageTtlDays */ + offlineStorageTtlDays?: (number|null); } /** Represents an EntityType. */ @@ -14783,6 +15124,9 @@ export namespace google { /** EntityType monitoringConfig. */ public monitoringConfig?: (google.cloud.aiplatform.v1.IFeaturestoreMonitoringConfig|null); + /** EntityType offlineStorageTtlDays. */ + public offlineStorageTtlDays: number; + /** * Creates a new EntityType instance using the specified properties. * @param [properties] Properties to set @@ -16714,6 +17058,9 @@ export namespace google { /** Featurestore state */ state?: (google.cloud.aiplatform.v1.Featurestore.State|keyof typeof google.cloud.aiplatform.v1.Featurestore.State|null); + /** Featurestore onlineStorageTtlDays */ + onlineStorageTtlDays?: (number|null); + /** Featurestore encryptionSpec */ encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); } @@ -16748,6 +17095,9 @@ export namespace google { /** Featurestore state. */ public state: (google.cloud.aiplatform.v1.Featurestore.State|keyof typeof google.cloud.aiplatform.v1.Featurestore.State); + /** Featurestore onlineStorageTtlDays. */ + public onlineStorageTtlDays: number; + /** Featurestore encryptionSpec. */ public encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); @@ -75393,6 +75743,7 @@ export namespace google { NVIDIA_TESLA_T4 = 5, NVIDIA_TESLA_A100 = 8, NVIDIA_A100_80GB = 9, + NVIDIA_L4 = 11, TPU_V2 = 6, TPU_V3 = 7, TPU_V4_POD = 10 @@ -84990,7 +85341,8 @@ export namespace google { AUTOML = 1, CUSTOM = 2, BQML = 3, - MODEL_GARDEN = 4 + MODEL_GARDEN = 4, + GENIE = 5 } } @@ -85549,6 +85901,12 @@ export namespace google { /** CustomJobSpec enableDashboardAccess */ enableDashboardAccess?: (boolean|null); + + /** CustomJobSpec experiment */ + experiment?: (string|null); + + /** CustomJobSpec experimentRun */ + experimentRun?: (string|null); } /** Represents a CustomJobSpec. */ @@ -85587,6 +85945,12 @@ export namespace google { /** CustomJobSpec enableDashboardAccess. */ public enableDashboardAccess: boolean; + /** CustomJobSpec experiment. */ + public experiment: string; + + /** CustomJobSpec experimentRun. */ + public experimentRun: string; + /** * Creates a new CustomJobSpec instance using the specified properties. * @param [properties] Properties to set @@ -92521,6 +92885,20 @@ export namespace google { * @returns Promise */ public undeployModel(request: google.cloud.aiplatform.v1beta1.IUndeployModelRequest): Promise; + + /** + * Calls MutateDeployedModel. + * @param request MutateDeployedModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public mutateDeployedModel(request: google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest, callback: google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModelCallback): void; + + /** + * Calls MutateDeployedModel. + * @param request MutateDeployedModelRequest message or plain object + * @returns Promise + */ + public mutateDeployedModel(request: google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest): Promise; } namespace EndpointService { @@ -92573,6 +92951,13 @@ export namespace google { * @param [response] Operation */ type UndeployModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.EndpointService|mutateDeployedModel}. + * @param error Error, if any + * @param [response] Operation + */ + type MutateDeployedModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of a CreateEndpointRequest. */ @@ -93902,6 +94287,309 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a MutateDeployedModelRequest. */ + interface IMutateDeployedModelRequest { + + /** MutateDeployedModelRequest endpoint */ + endpoint?: (string|null); + + /** MutateDeployedModelRequest deployedModel */ + deployedModel?: (google.cloud.aiplatform.v1beta1.IDeployedModel|null); + + /** MutateDeployedModelRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a MutateDeployedModelRequest. */ + class MutateDeployedModelRequest implements IMutateDeployedModelRequest { + + /** + * Constructs a new MutateDeployedModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest); + + /** MutateDeployedModelRequest endpoint. */ + public endpoint: string; + + /** MutateDeployedModelRequest deployedModel. */ + public deployedModel?: (google.cloud.aiplatform.v1beta1.IDeployedModel|null); + + /** MutateDeployedModelRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new MutateDeployedModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateDeployedModelRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest): google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest; + + /** + * Encodes the specified MutateDeployedModelRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest.verify|verify} messages. + * @param message MutateDeployedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateDeployedModelRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest.verify|verify} messages. + * @param message MutateDeployedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateDeployedModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateDeployedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest; + + /** + * Decodes a MutateDeployedModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateDeployedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest; + + /** + * Verifies a MutateDeployedModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateDeployedModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateDeployedModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest; + + /** + * Creates a plain object from a MutateDeployedModelRequest message. Also converts values to other types if specified. + * @param message MutateDeployedModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateDeployedModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateDeployedModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MutateDeployedModelResponse. */ + interface IMutateDeployedModelResponse { + + /** MutateDeployedModelResponse deployedModel */ + deployedModel?: (google.cloud.aiplatform.v1beta1.IDeployedModel|null); + } + + /** Represents a MutateDeployedModelResponse. */ + class MutateDeployedModelResponse implements IMutateDeployedModelResponse { + + /** + * Constructs a new MutateDeployedModelResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IMutateDeployedModelResponse); + + /** MutateDeployedModelResponse deployedModel. */ + public deployedModel?: (google.cloud.aiplatform.v1beta1.IDeployedModel|null); + + /** + * Creates a new MutateDeployedModelResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateDeployedModelResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IMutateDeployedModelResponse): google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse; + + /** + * Encodes the specified MutateDeployedModelResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse.verify|verify} messages. + * @param message MutateDeployedModelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IMutateDeployedModelResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateDeployedModelResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse.verify|verify} messages. + * @param message MutateDeployedModelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IMutateDeployedModelResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateDeployedModelResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateDeployedModelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse; + + /** + * Decodes a MutateDeployedModelResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateDeployedModelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse; + + /** + * Verifies a MutateDeployedModelResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateDeployedModelResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateDeployedModelResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse; + + /** + * Creates a plain object from a MutateDeployedModelResponse message. Also converts values to other types if specified. + * @param message MutateDeployedModelResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateDeployedModelResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateDeployedModelResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MutateDeployedModelOperationMetadata. */ + interface IMutateDeployedModelOperationMetadata { + + /** MutateDeployedModelOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null); + } + + /** Represents a MutateDeployedModelOperationMetadata. */ + class MutateDeployedModelOperationMetadata implements IMutateDeployedModelOperationMetadata { + + /** + * Constructs a new MutateDeployedModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IMutateDeployedModelOperationMetadata); + + /** MutateDeployedModelOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null); + + /** + * Creates a new MutateDeployedModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns MutateDeployedModelOperationMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IMutateDeployedModelOperationMetadata): google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata; + + /** + * Encodes the specified MutateDeployedModelOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata.verify|verify} messages. + * @param message MutateDeployedModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IMutateDeployedModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MutateDeployedModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata.verify|verify} messages. + * @param message MutateDeployedModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IMutateDeployedModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MutateDeployedModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutateDeployedModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata; + + /** + * Decodes a MutateDeployedModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutateDeployedModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata; + + /** + * Verifies a MutateDeployedModelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MutateDeployedModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutateDeployedModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata; + + /** + * Creates a plain object from a MutateDeployedModelOperationMetadata message. Also converts values to other types if specified. + * @param message MutateDeployedModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutateDeployedModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MutateDeployedModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an EntityType. */ interface IEntityType { @@ -136806,6 +137494,9 @@ export namespace google { /** Schedule createTime */ createTime?: (google.protobuf.ITimestamp|null); + /** Schedule updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + /** Schedule nextRunTime */ nextRunTime?: (google.protobuf.ITimestamp|null); @@ -136823,6 +137514,9 @@ export namespace google { /** Schedule catchUp */ catchUp?: (boolean|null); + + /** Schedule lastScheduledRunResponse */ + lastScheduledRunResponse?: (google.cloud.aiplatform.v1beta1.Schedule.IRunResponse|null); } /** Represents a Schedule. */ @@ -136864,6 +137558,9 @@ export namespace google { /** Schedule createTime. */ public createTime?: (google.protobuf.ITimestamp|null); + /** Schedule updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + /** Schedule nextRunTime. */ public nextRunTime?: (google.protobuf.ITimestamp|null); @@ -136882,6 +137579,9 @@ export namespace google { /** Schedule catchUp. */ public catchUp: boolean; + /** Schedule lastScheduledRunResponse. */ + public lastScheduledRunResponse?: (google.cloud.aiplatform.v1beta1.Schedule.IRunResponse|null); + /** Schedule timeSpecification. */ public timeSpecification?: "cron"; @@ -136968,6 +137668,109 @@ export namespace google { namespace Schedule { + /** Properties of a RunResponse. */ + interface IRunResponse { + + /** RunResponse scheduledRunTime */ + scheduledRunTime?: (google.protobuf.ITimestamp|null); + + /** RunResponse runResponse */ + runResponse?: (string|null); + } + + /** Represents a RunResponse. */ + class RunResponse implements IRunResponse { + + /** + * Constructs a new RunResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.Schedule.IRunResponse); + + /** RunResponse scheduledRunTime. */ + public scheduledRunTime?: (google.protobuf.ITimestamp|null); + + /** RunResponse runResponse. */ + public runResponse: string; + + /** + * Creates a new RunResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.Schedule.IRunResponse): google.cloud.aiplatform.v1beta1.Schedule.RunResponse; + + /** + * Encodes the specified RunResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Schedule.RunResponse.verify|verify} messages. + * @param message RunResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.Schedule.IRunResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Schedule.RunResponse.verify|verify} messages. + * @param message RunResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.Schedule.IRunResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.Schedule.RunResponse; + + /** + * Decodes a RunResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.Schedule.RunResponse; + + /** + * Verifies a RunResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.Schedule.RunResponse; + + /** + * Creates a plain object from a RunResponse message. Also converts values to other types if specified. + * @param message RunResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.Schedule.RunResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** State enum. */ enum State { STATE_UNSPECIFIED = 0, diff --git a/packages/google-cloud-aiplatform/protos/protos.js b/packages/google-cloud-aiplatform/protos/protos.js index 702e1ffb99e..6ffb0761d2f 100644 --- a/packages/google-cloud-aiplatform/protos/protos.js +++ b/packages/google-cloud-aiplatform/protos/protos.js @@ -77,6 +77,7 @@ * @property {number} NVIDIA_TESLA_P4=4 NVIDIA_TESLA_P4 value * @property {number} NVIDIA_TESLA_T4=5 NVIDIA_TESLA_T4 value * @property {number} NVIDIA_TESLA_A100=8 NVIDIA_TESLA_A100 value + * @property {number} NVIDIA_L4=11 NVIDIA_L4 value * @property {number} TPU_V2=6 TPU_V2 value * @property {number} TPU_V3=7 TPU_V3 value * @property {number} TPU_V4_POD=10 TPU_V4_POD value @@ -90,6 +91,7 @@ values[valuesById[4] = "NVIDIA_TESLA_P4"] = 4; values[valuesById[5] = "NVIDIA_TESLA_T4"] = 5; values[valuesById[8] = "NVIDIA_TESLA_A100"] = 8; + values[valuesById[11] = "NVIDIA_L4"] = 11; values[valuesById[6] = "TPU_V2"] = 6; values[valuesById[7] = "TPU_V3"] = 7; values[valuesById[10] = "TPU_V4_POD"] = 10; @@ -13154,6 +13156,7 @@ case 4: case 5: case 8: + case 11: case 6: case 7: case 10: @@ -13214,6 +13217,10 @@ case 8: message.acceleratorType = 8; break; + case "NVIDIA_L4": + case 11: + message.acceleratorType = 11; + break; case "TPU_V2": case 6: message.acceleratorType = 6; @@ -18039,6 +18046,7 @@ case 2: case 3: case 4: + case 5: break; } if (message.copy != null && message.hasOwnProperty("copy")) @@ -18086,6 +18094,10 @@ case 4: message.sourceType = 4; break; + case "GENIE": + case 5: + message.sourceType = 5; + break; } if (object.copy != null) message.copy = Boolean(object.copy); @@ -18151,6 +18163,7 @@ * @property {number} CUSTOM=2 CUSTOM value * @property {number} BQML=3 BQML value * @property {number} MODEL_GARDEN=4 MODEL_GARDEN value + * @property {number} GENIE=5 GENIE value */ ModelSourceInfo.ModelSourceType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -18159,6 +18172,7 @@ values[valuesById[2] = "CUSTOM"] = 2; values[valuesById[3] = "BQML"] = 3; values[valuesById[4] = "MODEL_GARDEN"] = 4; + values[valuesById[5] = "GENIE"] = 5; return values; })(); @@ -19763,6 +19777,8 @@ * @property {string|null} [tensorboard] CustomJobSpec tensorboard * @property {boolean|null} [enableWebAccess] CustomJobSpec enableWebAccess * @property {boolean|null} [enableDashboardAccess] CustomJobSpec enableDashboardAccess + * @property {string|null} [experiment] CustomJobSpec experiment + * @property {string|null} [experimentRun] CustomJobSpec experimentRun */ /** @@ -19854,6 +19870,22 @@ */ CustomJobSpec.prototype.enableDashboardAccess = false; + /** + * CustomJobSpec experiment. + * @member {string} experiment + * @memberof google.cloud.aiplatform.v1.CustomJobSpec + * @instance + */ + CustomJobSpec.prototype.experiment = ""; + + /** + * CustomJobSpec experimentRun. + * @member {string} experimentRun + * @memberof google.cloud.aiplatform.v1.CustomJobSpec + * @instance + */ + CustomJobSpec.prototype.experimentRun = ""; + /** * Creates a new CustomJobSpec instance using the specified properties. * @function create @@ -19898,6 +19930,10 @@ writer.uint32(/* id 13, wireType 2 =*/106).string(message.reservedIpRanges[i]); if (message.enableDashboardAccess != null && Object.hasOwnProperty.call(message, "enableDashboardAccess")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.enableDashboardAccess); + if (message.experiment != null && Object.hasOwnProperty.call(message, "experiment")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.experiment); + if (message.experimentRun != null && Object.hasOwnProperty.call(message, "experimentRun")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.experimentRun); return writer; }; @@ -19972,6 +20008,14 @@ message.enableDashboardAccess = reader.bool(); break; } + case 17: { + message.experiment = reader.string(); + break; + } + case 18: { + message.experimentRun = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -20048,6 +20092,12 @@ if (message.enableDashboardAccess != null && message.hasOwnProperty("enableDashboardAccess")) if (typeof message.enableDashboardAccess !== "boolean") return "enableDashboardAccess: boolean expected"; + if (message.experiment != null && message.hasOwnProperty("experiment")) + if (!$util.isString(message.experiment)) + return "experiment: string expected"; + if (message.experimentRun != null && message.hasOwnProperty("experimentRun")) + if (!$util.isString(message.experimentRun)) + return "experimentRun: string expected"; return null; }; @@ -20100,6 +20150,10 @@ message.enableWebAccess = Boolean(object.enableWebAccess); if (object.enableDashboardAccess != null) message.enableDashboardAccess = Boolean(object.enableDashboardAccess); + if (object.experiment != null) + message.experiment = String(object.experiment); + if (object.experimentRun != null) + message.experimentRun = String(object.experimentRun); return message; }; @@ -20128,6 +20182,8 @@ object.tensorboard = ""; object.enableWebAccess = false; object.enableDashboardAccess = false; + object.experiment = ""; + object.experimentRun = ""; } if (message.workerPoolSpecs && message.workerPoolSpecs.length) { object.workerPoolSpecs = []; @@ -20153,6 +20209,10 @@ } if (message.enableDashboardAccess != null && message.hasOwnProperty("enableDashboardAccess")) object.enableDashboardAccess = message.enableDashboardAccess; + if (message.experiment != null && message.hasOwnProperty("experiment")) + object.experiment = message.experiment; + if (message.experimentRun != null && message.hasOwnProperty("experimentRun")) + object.experimentRun = message.experimentRun; return object; }; @@ -34686,6 +34746,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1.EndpointService|mutateDeployedModel}. + * @memberof google.cloud.aiplatform.v1.EndpointService + * @typedef MutateDeployedModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls MutateDeployedModel. + * @function mutateDeployedModel + * @memberof google.cloud.aiplatform.v1.EndpointService + * @instance + * @param {google.cloud.aiplatform.v1.IMutateDeployedModelRequest} request MutateDeployedModelRequest message or plain object + * @param {google.cloud.aiplatform.v1.EndpointService.MutateDeployedModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EndpointService.prototype.mutateDeployedModel = function mutateDeployedModel(request, callback) { + return this.rpcCall(mutateDeployedModel, $root.google.cloud.aiplatform.v1.MutateDeployedModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "MutateDeployedModel" }); + + /** + * Calls MutateDeployedModel. + * @function mutateDeployedModel + * @memberof google.cloud.aiplatform.v1.EndpointService + * @instance + * @param {google.cloud.aiplatform.v1.IMutateDeployedModelRequest} request MutateDeployedModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return EndpointService; })(); @@ -37743,6 +37836,682 @@ return UndeployModelOperationMetadata; })(); + v1.MutateDeployedModelRequest = (function() { + + /** + * Properties of a MutateDeployedModelRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IMutateDeployedModelRequest + * @property {string|null} [endpoint] MutateDeployedModelRequest endpoint + * @property {google.cloud.aiplatform.v1.IDeployedModel|null} [deployedModel] MutateDeployedModelRequest deployedModel + * @property {google.protobuf.IFieldMask|null} [updateMask] MutateDeployedModelRequest updateMask + */ + + /** + * Constructs a new MutateDeployedModelRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a MutateDeployedModelRequest. + * @implements IMutateDeployedModelRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IMutateDeployedModelRequest=} [properties] Properties to set + */ + function MutateDeployedModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutateDeployedModelRequest endpoint. + * @member {string} endpoint + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelRequest + * @instance + */ + MutateDeployedModelRequest.prototype.endpoint = ""; + + /** + * MutateDeployedModelRequest deployedModel. + * @member {google.cloud.aiplatform.v1.IDeployedModel|null|undefined} deployedModel + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelRequest + * @instance + */ + MutateDeployedModelRequest.prototype.deployedModel = null; + + /** + * MutateDeployedModelRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelRequest + * @instance + */ + MutateDeployedModelRequest.prototype.updateMask = null; + + /** + * Creates a new MutateDeployedModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelRequest + * @static + * @param {google.cloud.aiplatform.v1.IMutateDeployedModelRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MutateDeployedModelRequest} MutateDeployedModelRequest instance + */ + MutateDeployedModelRequest.create = function create(properties) { + return new MutateDeployedModelRequest(properties); + }; + + /** + * Encodes the specified MutateDeployedModelRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.MutateDeployedModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelRequest + * @static + * @param {google.cloud.aiplatform.v1.IMutateDeployedModelRequest} message MutateDeployedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateDeployedModelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.endpoint); + if (message.deployedModel != null && Object.hasOwnProperty.call(message, "deployedModel")) + $root.google.cloud.aiplatform.v1.DeployedModel.encode(message.deployedModel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutateDeployedModelRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MutateDeployedModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelRequest + * @static + * @param {google.cloud.aiplatform.v1.IMutateDeployedModelRequest} message MutateDeployedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateDeployedModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateDeployedModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.MutateDeployedModelRequest} MutateDeployedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateDeployedModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MutateDeployedModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.endpoint = reader.string(); + break; + } + case 2: { + message.deployedModel = $root.google.cloud.aiplatform.v1.DeployedModel.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateDeployedModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.MutateDeployedModelRequest} MutateDeployedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateDeployedModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateDeployedModelRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateDeployedModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + if (!$util.isString(message.endpoint)) + return "endpoint: string expected"; + if (message.deployedModel != null && message.hasOwnProperty("deployedModel")) { + var error = $root.google.cloud.aiplatform.v1.DeployedModel.verify(message.deployedModel); + if (error) + return "deployedModel." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a MutateDeployedModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.MutateDeployedModelRequest} MutateDeployedModelRequest + */ + MutateDeployedModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MutateDeployedModelRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.MutateDeployedModelRequest(); + if (object.endpoint != null) + message.endpoint = String(object.endpoint); + if (object.deployedModel != null) { + if (typeof object.deployedModel !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MutateDeployedModelRequest.deployedModel: object expected"); + message.deployedModel = $root.google.cloud.aiplatform.v1.DeployedModel.fromObject(object.deployedModel); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MutateDeployedModelRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a MutateDeployedModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelRequest + * @static + * @param {google.cloud.aiplatform.v1.MutateDeployedModelRequest} message MutateDeployedModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateDeployedModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.endpoint = ""; + object.deployedModel = null; + object.updateMask = null; + } + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + object.endpoint = message.endpoint; + if (message.deployedModel != null && message.hasOwnProperty("deployedModel")) + object.deployedModel = $root.google.cloud.aiplatform.v1.DeployedModel.toObject(message.deployedModel, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this MutateDeployedModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelRequest + * @instance + * @returns {Object.} JSON object + */ + MutateDeployedModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateDeployedModelRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateDeployedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MutateDeployedModelRequest"; + }; + + return MutateDeployedModelRequest; + })(); + + v1.MutateDeployedModelResponse = (function() { + + /** + * Properties of a MutateDeployedModelResponse. + * @memberof google.cloud.aiplatform.v1 + * @interface IMutateDeployedModelResponse + * @property {google.cloud.aiplatform.v1.IDeployedModel|null} [deployedModel] MutateDeployedModelResponse deployedModel + */ + + /** + * Constructs a new MutateDeployedModelResponse. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a MutateDeployedModelResponse. + * @implements IMutateDeployedModelResponse + * @constructor + * @param {google.cloud.aiplatform.v1.IMutateDeployedModelResponse=} [properties] Properties to set + */ + function MutateDeployedModelResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutateDeployedModelResponse deployedModel. + * @member {google.cloud.aiplatform.v1.IDeployedModel|null|undefined} deployedModel + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelResponse + * @instance + */ + MutateDeployedModelResponse.prototype.deployedModel = null; + + /** + * Creates a new MutateDeployedModelResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelResponse + * @static + * @param {google.cloud.aiplatform.v1.IMutateDeployedModelResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MutateDeployedModelResponse} MutateDeployedModelResponse instance + */ + MutateDeployedModelResponse.create = function create(properties) { + return new MutateDeployedModelResponse(properties); + }; + + /** + * Encodes the specified MutateDeployedModelResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.MutateDeployedModelResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelResponse + * @static + * @param {google.cloud.aiplatform.v1.IMutateDeployedModelResponse} message MutateDeployedModelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateDeployedModelResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployedModel != null && Object.hasOwnProperty.call(message, "deployedModel")) + $root.google.cloud.aiplatform.v1.DeployedModel.encode(message.deployedModel, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutateDeployedModelResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MutateDeployedModelResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelResponse + * @static + * @param {google.cloud.aiplatform.v1.IMutateDeployedModelResponse} message MutateDeployedModelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateDeployedModelResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateDeployedModelResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.MutateDeployedModelResponse} MutateDeployedModelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateDeployedModelResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MutateDeployedModelResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deployedModel = $root.google.cloud.aiplatform.v1.DeployedModel.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateDeployedModelResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.MutateDeployedModelResponse} MutateDeployedModelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateDeployedModelResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateDeployedModelResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateDeployedModelResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployedModel != null && message.hasOwnProperty("deployedModel")) { + var error = $root.google.cloud.aiplatform.v1.DeployedModel.verify(message.deployedModel); + if (error) + return "deployedModel." + error; + } + return null; + }; + + /** + * Creates a MutateDeployedModelResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.MutateDeployedModelResponse} MutateDeployedModelResponse + */ + MutateDeployedModelResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MutateDeployedModelResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1.MutateDeployedModelResponse(); + if (object.deployedModel != null) { + if (typeof object.deployedModel !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MutateDeployedModelResponse.deployedModel: object expected"); + message.deployedModel = $root.google.cloud.aiplatform.v1.DeployedModel.fromObject(object.deployedModel); + } + return message; + }; + + /** + * Creates a plain object from a MutateDeployedModelResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelResponse + * @static + * @param {google.cloud.aiplatform.v1.MutateDeployedModelResponse} message MutateDeployedModelResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateDeployedModelResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.deployedModel = null; + if (message.deployedModel != null && message.hasOwnProperty("deployedModel")) + object.deployedModel = $root.google.cloud.aiplatform.v1.DeployedModel.toObject(message.deployedModel, options); + return object; + }; + + /** + * Converts this MutateDeployedModelResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelResponse + * @instance + * @returns {Object.} JSON object + */ + MutateDeployedModelResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateDeployedModelResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateDeployedModelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MutateDeployedModelResponse"; + }; + + return MutateDeployedModelResponse; + })(); + + v1.MutateDeployedModelOperationMetadata = (function() { + + /** + * Properties of a MutateDeployedModelOperationMetadata. + * @memberof google.cloud.aiplatform.v1 + * @interface IMutateDeployedModelOperationMetadata + * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] MutateDeployedModelOperationMetadata genericMetadata + */ + + /** + * Constructs a new MutateDeployedModelOperationMetadata. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a MutateDeployedModelOperationMetadata. + * @implements IMutateDeployedModelOperationMetadata + * @constructor + * @param {google.cloud.aiplatform.v1.IMutateDeployedModelOperationMetadata=} [properties] Properties to set + */ + function MutateDeployedModelOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutateDeployedModelOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata + * @instance + */ + MutateDeployedModelOperationMetadata.prototype.genericMetadata = null; + + /** + * Creates a new MutateDeployedModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1.IMutateDeployedModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata} MutateDeployedModelOperationMetadata instance + */ + MutateDeployedModelOperationMetadata.create = function create(properties) { + return new MutateDeployedModelOperationMetadata(properties); + }; + + /** + * Encodes the specified MutateDeployedModelOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1.IMutateDeployedModelOperationMetadata} message MutateDeployedModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateDeployedModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutateDeployedModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1.IMutateDeployedModelOperationMetadata} message MutateDeployedModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateDeployedModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateDeployedModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata} MutateDeployedModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateDeployedModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateDeployedModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata} MutateDeployedModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateDeployedModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateDeployedModelOperationMetadata message. + * @function verify + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateDeployedModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } + return null; + }; + + /** + * Creates a MutateDeployedModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata} MutateDeployedModelOperationMetadata + */ + MutateDeployedModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata) + return object; + var message = new $root.google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); + } + return message; + }; + + /** + * Creates a plain object from a MutateDeployedModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata} message MutateDeployedModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateDeployedModelOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); + return object; + }; + + /** + * Converts this MutateDeployedModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + MutateDeployedModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateDeployedModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateDeployedModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata"; + }; + + return MutateDeployedModelOperationMetadata; + })(); + v1.EntityType = (function() { /** @@ -37756,6 +38525,7 @@ * @property {Object.|null} [labels] EntityType labels * @property {string|null} [etag] EntityType etag * @property {google.cloud.aiplatform.v1.IFeaturestoreMonitoringConfig|null} [monitoringConfig] EntityType monitoringConfig + * @property {number|null} [offlineStorageTtlDays] EntityType offlineStorageTtlDays */ /** @@ -37830,6 +38600,14 @@ */ EntityType.prototype.monitoringConfig = null; + /** + * EntityType offlineStorageTtlDays. + * @member {number} offlineStorageTtlDays + * @memberof google.cloud.aiplatform.v1.EntityType + * @instance + */ + EntityType.prototype.offlineStorageTtlDays = 0; + /** * Creates a new EntityType instance using the specified properties. * @function create @@ -37869,6 +38647,8 @@ writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); if (message.monitoringConfig != null && Object.hasOwnProperty.call(message, "monitoringConfig")) $root.google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.encode(message.monitoringConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.offlineStorageTtlDays != null && Object.hasOwnProperty.call(message, "offlineStorageTtlDays")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.offlineStorageTtlDays); return writer; }; @@ -37950,6 +38730,10 @@ message.monitoringConfig = $root.google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.decode(reader, reader.uint32()); break; } + case 10: { + message.offlineStorageTtlDays = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -38017,6 +38801,9 @@ if (error) return "monitoringConfig." + error; } + if (message.offlineStorageTtlDays != null && message.hasOwnProperty("offlineStorageTtlDays")) + if (!$util.isInteger(message.offlineStorageTtlDays)) + return "offlineStorageTtlDays: integer expected"; return null; }; @@ -38060,6 +38847,8 @@ throw TypeError(".google.cloud.aiplatform.v1.EntityType.monitoringConfig: object expected"); message.monitoringConfig = $root.google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.fromObject(object.monitoringConfig); } + if (object.offlineStorageTtlDays != null) + message.offlineStorageTtlDays = object.offlineStorageTtlDays | 0; return message; }; @@ -38085,6 +38874,7 @@ object.updateTime = null; object.etag = ""; object.monitoringConfig = null; + object.offlineStorageTtlDays = 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -38104,6 +38894,8 @@ object.etag = message.etag; if (message.monitoringConfig != null && message.hasOwnProperty("monitoringConfig")) object.monitoringConfig = $root.google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.toObject(message.monitoringConfig, options); + if (message.offlineStorageTtlDays != null && message.hasOwnProperty("offlineStorageTtlDays")) + object.offlineStorageTtlDays = message.offlineStorageTtlDays; return object; }; @@ -43041,6 +43833,7 @@ * @property {Object.|null} [labels] Featurestore labels * @property {google.cloud.aiplatform.v1.Featurestore.IOnlineServingConfig|null} [onlineServingConfig] Featurestore onlineServingConfig * @property {google.cloud.aiplatform.v1.Featurestore.State|null} [state] Featurestore state + * @property {number|null} [onlineStorageTtlDays] Featurestore onlineStorageTtlDays * @property {google.cloud.aiplatform.v1.IEncryptionSpec|null} [encryptionSpec] Featurestore encryptionSpec */ @@ -43116,6 +43909,14 @@ */ Featurestore.prototype.state = 0; + /** + * Featurestore onlineStorageTtlDays. + * @member {number} onlineStorageTtlDays + * @memberof google.cloud.aiplatform.v1.Featurestore + * @instance + */ + Featurestore.prototype.onlineStorageTtlDays = 0; + /** * Featurestore encryptionSpec. * @member {google.cloud.aiplatform.v1.IEncryptionSpec|null|undefined} encryptionSpec @@ -43165,6 +43966,8 @@ writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) $root.google.cloud.aiplatform.v1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.onlineStorageTtlDays != null && Object.hasOwnProperty.call(message, "onlineStorageTtlDays")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.onlineStorageTtlDays); return writer; }; @@ -43246,6 +44049,10 @@ message.state = reader.int32(); break; } + case 13: { + message.onlineStorageTtlDays = reader.int32(); + break; + } case 10: { message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.decode(reader, reader.uint32()); break; @@ -43323,6 +44130,9 @@ case 2: break; } + if (message.onlineStorageTtlDays != null && message.hasOwnProperty("onlineStorageTtlDays")) + if (!$util.isInteger(message.onlineStorageTtlDays)) + return "onlineStorageTtlDays: integer expected"; if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { var error = $root.google.cloud.aiplatform.v1.EncryptionSpec.verify(message.encryptionSpec); if (error) @@ -43389,6 +44199,8 @@ message.state = 2; break; } + if (object.onlineStorageTtlDays != null) + message.onlineStorageTtlDays = object.onlineStorageTtlDays | 0; if (object.encryptionSpec != null) { if (typeof object.encryptionSpec !== "object") throw TypeError(".google.cloud.aiplatform.v1.Featurestore.encryptionSpec: object expected"); @@ -43420,6 +44232,7 @@ object.onlineServingConfig = null; object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; object.encryptionSpec = null; + object.onlineStorageTtlDays = 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -43441,6 +44254,8 @@ object.state = options.enums === String ? $root.google.cloud.aiplatform.v1.Featurestore.State[message.state] === undefined ? message.state : $root.google.cloud.aiplatform.v1.Featurestore.State[message.state] : message.state; if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) object.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.toObject(message.encryptionSpec, options); + if (message.onlineStorageTtlDays != null && message.hasOwnProperty("onlineStorageTtlDays")) + object.onlineStorageTtlDays = message.onlineStorageTtlDays; return object; }; @@ -181514,6 +182329,7 @@ * @property {number} NVIDIA_TESLA_T4=5 NVIDIA_TESLA_T4 value * @property {number} NVIDIA_TESLA_A100=8 NVIDIA_TESLA_A100 value * @property {number} NVIDIA_A100_80GB=9 NVIDIA_A100_80GB value + * @property {number} NVIDIA_L4=11 NVIDIA_L4 value * @property {number} TPU_V2=6 TPU_V2 value * @property {number} TPU_V3=7 TPU_V3 value * @property {number} TPU_V4_POD=10 TPU_V4_POD value @@ -181528,6 +182344,7 @@ values[valuesById[5] = "NVIDIA_TESLA_T4"] = 5; values[valuesById[8] = "NVIDIA_TESLA_A100"] = 8; values[valuesById[9] = "NVIDIA_A100_80GB"] = 9; + values[valuesById[11] = "NVIDIA_L4"] = 11; values[valuesById[6] = "TPU_V2"] = 6; values[valuesById[7] = "TPU_V3"] = 7; values[valuesById[10] = "TPU_V4_POD"] = 10; @@ -195369,6 +196186,7 @@ case 5: case 8: case 9: + case 11: case 6: case 7: case 10: @@ -195433,6 +196251,10 @@ case 9: message.acceleratorType = 9; break; + case "NVIDIA_L4": + case 11: + message.acceleratorType = 11; + break; case "TPU_V2": case 6: message.acceleratorType = 6; @@ -206604,6 +207426,7 @@ case 2: case 3: case 4: + case 5: break; } if (message.copy != null && message.hasOwnProperty("copy")) @@ -206651,6 +207474,10 @@ case 4: message.sourceType = 4; break; + case "GENIE": + case 5: + message.sourceType = 5; + break; } if (object.copy != null) message.copy = Boolean(object.copy); @@ -206716,6 +207543,7 @@ * @property {number} CUSTOM=2 CUSTOM value * @property {number} BQML=3 BQML value * @property {number} MODEL_GARDEN=4 MODEL_GARDEN value + * @property {number} GENIE=5 GENIE value */ ModelSourceInfo.ModelSourceType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -206724,6 +207552,7 @@ values[valuesById[2] = "CUSTOM"] = 2; values[valuesById[3] = "BQML"] = 3; values[valuesById[4] = "MODEL_GARDEN"] = 4; + values[valuesById[5] = "GENIE"] = 5; return values; })(); @@ -208328,6 +209157,8 @@ * @property {string|null} [tensorboard] CustomJobSpec tensorboard * @property {boolean|null} [enableWebAccess] CustomJobSpec enableWebAccess * @property {boolean|null} [enableDashboardAccess] CustomJobSpec enableDashboardAccess + * @property {string|null} [experiment] CustomJobSpec experiment + * @property {string|null} [experimentRun] CustomJobSpec experimentRun */ /** @@ -208419,6 +209250,22 @@ */ CustomJobSpec.prototype.enableDashboardAccess = false; + /** + * CustomJobSpec experiment. + * @member {string} experiment + * @memberof google.cloud.aiplatform.v1beta1.CustomJobSpec + * @instance + */ + CustomJobSpec.prototype.experiment = ""; + + /** + * CustomJobSpec experimentRun. + * @member {string} experimentRun + * @memberof google.cloud.aiplatform.v1beta1.CustomJobSpec + * @instance + */ + CustomJobSpec.prototype.experimentRun = ""; + /** * Creates a new CustomJobSpec instance using the specified properties. * @function create @@ -208463,6 +209310,10 @@ writer.uint32(/* id 13, wireType 2 =*/106).string(message.reservedIpRanges[i]); if (message.enableDashboardAccess != null && Object.hasOwnProperty.call(message, "enableDashboardAccess")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.enableDashboardAccess); + if (message.experiment != null && Object.hasOwnProperty.call(message, "experiment")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.experiment); + if (message.experimentRun != null && Object.hasOwnProperty.call(message, "experimentRun")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.experimentRun); return writer; }; @@ -208537,6 +209388,14 @@ message.enableDashboardAccess = reader.bool(); break; } + case 17: { + message.experiment = reader.string(); + break; + } + case 18: { + message.experimentRun = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -208613,6 +209472,12 @@ if (message.enableDashboardAccess != null && message.hasOwnProperty("enableDashboardAccess")) if (typeof message.enableDashboardAccess !== "boolean") return "enableDashboardAccess: boolean expected"; + if (message.experiment != null && message.hasOwnProperty("experiment")) + if (!$util.isString(message.experiment)) + return "experiment: string expected"; + if (message.experimentRun != null && message.hasOwnProperty("experimentRun")) + if (!$util.isString(message.experimentRun)) + return "experimentRun: string expected"; return null; }; @@ -208665,6 +209530,10 @@ message.enableWebAccess = Boolean(object.enableWebAccess); if (object.enableDashboardAccess != null) message.enableDashboardAccess = Boolean(object.enableDashboardAccess); + if (object.experiment != null) + message.experiment = String(object.experiment); + if (object.experimentRun != null) + message.experimentRun = String(object.experimentRun); return message; }; @@ -208693,6 +209562,8 @@ object.tensorboard = ""; object.enableWebAccess = false; object.enableDashboardAccess = false; + object.experiment = ""; + object.experimentRun = ""; } if (message.workerPoolSpecs && message.workerPoolSpecs.length) { object.workerPoolSpecs = []; @@ -208718,6 +209589,10 @@ } if (message.enableDashboardAccess != null && message.hasOwnProperty("enableDashboardAccess")) object.enableDashboardAccess = message.enableDashboardAccess; + if (message.experiment != null && message.hasOwnProperty("experiment")) + object.experiment = message.experiment; + if (message.experimentRun != null && message.hasOwnProperty("experimentRun")) + object.experimentRun = message.experimentRun; return object; }; @@ -225928,6 +226803,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.EndpointService|mutateDeployedModel}. + * @memberof google.cloud.aiplatform.v1beta1.EndpointService + * @typedef MutateDeployedModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls MutateDeployedModel. + * @function mutateDeployedModel + * @memberof google.cloud.aiplatform.v1beta1.EndpointService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest} request MutateDeployedModelRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EndpointService.prototype.mutateDeployedModel = function mutateDeployedModel(request, callback) { + return this.rpcCall(mutateDeployedModel, $root.google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "MutateDeployedModel" }); + + /** + * Calls MutateDeployedModel. + * @function mutateDeployedModel + * @memberof google.cloud.aiplatform.v1beta1.EndpointService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest} request MutateDeployedModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return EndpointService; })(); @@ -228962,6 +229870,682 @@ return UndeployModelOperationMetadata; })(); + v1beta1.MutateDeployedModelRequest = (function() { + + /** + * Properties of a MutateDeployedModelRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IMutateDeployedModelRequest + * @property {string|null} [endpoint] MutateDeployedModelRequest endpoint + * @property {google.cloud.aiplatform.v1beta1.IDeployedModel|null} [deployedModel] MutateDeployedModelRequest deployedModel + * @property {google.protobuf.IFieldMask|null} [updateMask] MutateDeployedModelRequest updateMask + */ + + /** + * Constructs a new MutateDeployedModelRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a MutateDeployedModelRequest. + * @implements IMutateDeployedModelRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest=} [properties] Properties to set + */ + function MutateDeployedModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutateDeployedModelRequest endpoint. + * @member {string} endpoint + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest + * @instance + */ + MutateDeployedModelRequest.prototype.endpoint = ""; + + /** + * MutateDeployedModelRequest deployedModel. + * @member {google.cloud.aiplatform.v1beta1.IDeployedModel|null|undefined} deployedModel + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest + * @instance + */ + MutateDeployedModelRequest.prototype.deployedModel = null; + + /** + * MutateDeployedModelRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest + * @instance + */ + MutateDeployedModelRequest.prototype.updateMask = null; + + /** + * Creates a new MutateDeployedModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest} MutateDeployedModelRequest instance + */ + MutateDeployedModelRequest.create = function create(properties) { + return new MutateDeployedModelRequest(properties); + }; + + /** + * Encodes the specified MutateDeployedModelRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest} message MutateDeployedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateDeployedModelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.endpoint); + if (message.deployedModel != null && Object.hasOwnProperty.call(message, "deployedModel")) + $root.google.cloud.aiplatform.v1beta1.DeployedModel.encode(message.deployedModel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutateDeployedModelRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest} message MutateDeployedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateDeployedModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateDeployedModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest} MutateDeployedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateDeployedModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.endpoint = reader.string(); + break; + } + case 2: { + message.deployedModel = $root.google.cloud.aiplatform.v1beta1.DeployedModel.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateDeployedModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest} MutateDeployedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateDeployedModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateDeployedModelRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateDeployedModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + if (!$util.isString(message.endpoint)) + return "endpoint: string expected"; + if (message.deployedModel != null && message.hasOwnProperty("deployedModel")) { + var error = $root.google.cloud.aiplatform.v1beta1.DeployedModel.verify(message.deployedModel); + if (error) + return "deployedModel." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a MutateDeployedModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest} MutateDeployedModelRequest + */ + MutateDeployedModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest(); + if (object.endpoint != null) + message.endpoint = String(object.endpoint); + if (object.deployedModel != null) { + if (typeof object.deployedModel !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest.deployedModel: object expected"); + message.deployedModel = $root.google.cloud.aiplatform.v1beta1.DeployedModel.fromObject(object.deployedModel); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a MutateDeployedModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest} message MutateDeployedModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateDeployedModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.endpoint = ""; + object.deployedModel = null; + object.updateMask = null; + } + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + object.endpoint = message.endpoint; + if (message.deployedModel != null && message.hasOwnProperty("deployedModel")) + object.deployedModel = $root.google.cloud.aiplatform.v1beta1.DeployedModel.toObject(message.deployedModel, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this MutateDeployedModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest + * @instance + * @returns {Object.} JSON object + */ + MutateDeployedModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateDeployedModelRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateDeployedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest"; + }; + + return MutateDeployedModelRequest; + })(); + + v1beta1.MutateDeployedModelResponse = (function() { + + /** + * Properties of a MutateDeployedModelResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IMutateDeployedModelResponse + * @property {google.cloud.aiplatform.v1beta1.IDeployedModel|null} [deployedModel] MutateDeployedModelResponse deployedModel + */ + + /** + * Constructs a new MutateDeployedModelResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a MutateDeployedModelResponse. + * @implements IMutateDeployedModelResponse + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IMutateDeployedModelResponse=} [properties] Properties to set + */ + function MutateDeployedModelResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutateDeployedModelResponse deployedModel. + * @member {google.cloud.aiplatform.v1beta1.IDeployedModel|null|undefined} deployedModel + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse + * @instance + */ + MutateDeployedModelResponse.prototype.deployedModel = null; + + /** + * Creates a new MutateDeployedModelResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IMutateDeployedModelResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse} MutateDeployedModelResponse instance + */ + MutateDeployedModelResponse.create = function create(properties) { + return new MutateDeployedModelResponse(properties); + }; + + /** + * Encodes the specified MutateDeployedModelResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IMutateDeployedModelResponse} message MutateDeployedModelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateDeployedModelResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployedModel != null && Object.hasOwnProperty.call(message, "deployedModel")) + $root.google.cloud.aiplatform.v1beta1.DeployedModel.encode(message.deployedModel, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutateDeployedModelResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IMutateDeployedModelResponse} message MutateDeployedModelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateDeployedModelResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateDeployedModelResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse} MutateDeployedModelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateDeployedModelResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deployedModel = $root.google.cloud.aiplatform.v1beta1.DeployedModel.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateDeployedModelResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse} MutateDeployedModelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateDeployedModelResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateDeployedModelResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateDeployedModelResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployedModel != null && message.hasOwnProperty("deployedModel")) { + var error = $root.google.cloud.aiplatform.v1beta1.DeployedModel.verify(message.deployedModel); + if (error) + return "deployedModel." + error; + } + return null; + }; + + /** + * Creates a MutateDeployedModelResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse} MutateDeployedModelResponse + */ + MutateDeployedModelResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse(); + if (object.deployedModel != null) { + if (typeof object.deployedModel !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse.deployedModel: object expected"); + message.deployedModel = $root.google.cloud.aiplatform.v1beta1.DeployedModel.fromObject(object.deployedModel); + } + return message; + }; + + /** + * Creates a plain object from a MutateDeployedModelResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse} message MutateDeployedModelResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateDeployedModelResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.deployedModel = null; + if (message.deployedModel != null && message.hasOwnProperty("deployedModel")) + object.deployedModel = $root.google.cloud.aiplatform.v1beta1.DeployedModel.toObject(message.deployedModel, options); + return object; + }; + + /** + * Converts this MutateDeployedModelResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse + * @instance + * @returns {Object.} JSON object + */ + MutateDeployedModelResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateDeployedModelResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateDeployedModelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse"; + }; + + return MutateDeployedModelResponse; + })(); + + v1beta1.MutateDeployedModelOperationMetadata = (function() { + + /** + * Properties of a MutateDeployedModelOperationMetadata. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IMutateDeployedModelOperationMetadata + * @property {google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null} [genericMetadata] MutateDeployedModelOperationMetadata genericMetadata + */ + + /** + * Constructs a new MutateDeployedModelOperationMetadata. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a MutateDeployedModelOperationMetadata. + * @implements IMutateDeployedModelOperationMetadata + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IMutateDeployedModelOperationMetadata=} [properties] Properties to set + */ + function MutateDeployedModelOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MutateDeployedModelOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata + * @instance + */ + MutateDeployedModelOperationMetadata.prototype.genericMetadata = null; + + /** + * Creates a new MutateDeployedModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IMutateDeployedModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata} MutateDeployedModelOperationMetadata instance + */ + MutateDeployedModelOperationMetadata.create = function create(properties) { + return new MutateDeployedModelOperationMetadata(properties); + }; + + /** + * Encodes the specified MutateDeployedModelOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IMutateDeployedModelOperationMetadata} message MutateDeployedModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateDeployedModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutateDeployedModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IMutateDeployedModelOperationMetadata} message MutateDeployedModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutateDeployedModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutateDeployedModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata} MutateDeployedModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateDeployedModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MutateDeployedModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata} MutateDeployedModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutateDeployedModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MutateDeployedModelOperationMetadata message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutateDeployedModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } + return null; + }; + + /** + * Creates a MutateDeployedModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata} MutateDeployedModelOperationMetadata + */ + MutateDeployedModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.fromObject(object.genericMetadata); + } + return message; + }; + + /** + * Creates a plain object from a MutateDeployedModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata} message MutateDeployedModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutateDeployedModelOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.toObject(message.genericMetadata, options); + return object; + }; + + /** + * Converts this MutateDeployedModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + MutateDeployedModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MutateDeployedModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MutateDeployedModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata"; + }; + + return MutateDeployedModelOperationMetadata; + })(); + v1beta1.EntityType = (function() { /** @@ -330722,12 +332306,14 @@ * @property {number|Long|null} [startedRunCount] Schedule startedRunCount * @property {google.cloud.aiplatform.v1beta1.Schedule.State|null} [state] Schedule state * @property {google.protobuf.ITimestamp|null} [createTime] Schedule createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Schedule updateTime * @property {google.protobuf.ITimestamp|null} [nextRunTime] Schedule nextRunTime * @property {google.protobuf.ITimestamp|null} [lastPauseTime] Schedule lastPauseTime * @property {google.protobuf.ITimestamp|null} [lastResumeTime] Schedule lastResumeTime * @property {number|Long|null} [maxConcurrentRunCount] Schedule maxConcurrentRunCount * @property {boolean|null} [allowQueueing] Schedule allowQueueing * @property {boolean|null} [catchUp] Schedule catchUp + * @property {google.cloud.aiplatform.v1beta1.Schedule.IRunResponse|null} [lastScheduledRunResponse] Schedule lastScheduledRunResponse */ /** @@ -330825,6 +332411,14 @@ */ Schedule.prototype.createTime = null; + /** + * Schedule updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.aiplatform.v1beta1.Schedule + * @instance + */ + Schedule.prototype.updateTime = null; + /** * Schedule nextRunTime. * @member {google.protobuf.ITimestamp|null|undefined} nextRunTime @@ -330873,6 +332467,14 @@ */ Schedule.prototype.catchUp = false; + /** + * Schedule lastScheduledRunResponse. + * @member {google.cloud.aiplatform.v1beta1.Schedule.IRunResponse|null|undefined} lastScheduledRunResponse + * @memberof google.cloud.aiplatform.v1beta1.Schedule + * @instance + */ + Schedule.prototype.lastScheduledRunResponse = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -330954,6 +332556,10 @@ writer.uint32(/* id 16, wireType 0 =*/128).int64(message.maxRunCount); if (message.startedRunCount != null && Object.hasOwnProperty.call(message, "startedRunCount")) writer.uint32(/* id 17, wireType 0 =*/136).int64(message.startedRunCount); + if (message.lastScheduledRunResponse != null && Object.hasOwnProperty.call(message, "lastScheduledRunResponse")) + $root.google.cloud.aiplatform.v1beta1.Schedule.RunResponse.encode(message.lastScheduledRunResponse, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); return writer; }; @@ -331028,6 +332634,10 @@ message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } + case 19: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } case 7: { message.nextRunTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; @@ -331052,6 +332662,10 @@ message.catchUp = reader.bool(); break; } + case 18: { + message.lastScheduledRunResponse = $root.google.cloud.aiplatform.v1beta1.Schedule.RunResponse.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -331138,6 +332752,11 @@ if (error) return "createTime." + error; } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } if (message.nextRunTime != null && message.hasOwnProperty("nextRunTime")) { var error = $root.google.protobuf.Timestamp.verify(message.nextRunTime); if (error) @@ -331162,6 +332781,11 @@ if (message.catchUp != null && message.hasOwnProperty("catchUp")) if (typeof message.catchUp !== "boolean") return "catchUp: boolean expected"; + if (message.lastScheduledRunResponse != null && message.hasOwnProperty("lastScheduledRunResponse")) { + var error = $root.google.cloud.aiplatform.v1beta1.Schedule.RunResponse.verify(message.lastScheduledRunResponse); + if (error) + return "lastScheduledRunResponse." + error; + } return null; }; @@ -331245,6 +332869,11 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.Schedule.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Schedule.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } if (object.nextRunTime != null) { if (typeof object.nextRunTime !== "object") throw TypeError(".google.cloud.aiplatform.v1beta1.Schedule.nextRunTime: object expected"); @@ -331273,6 +332902,11 @@ message.allowQueueing = Boolean(object.allowQueueing); if (object.catchUp != null) message.catchUp = Boolean(object.catchUp); + if (object.lastScheduledRunResponse != null) { + if (typeof object.lastScheduledRunResponse !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Schedule.lastScheduledRunResponse: object expected"); + message.lastScheduledRunResponse = $root.google.cloud.aiplatform.v1beta1.Schedule.RunResponse.fromObject(object.lastScheduledRunResponse); + } return message; }; @@ -331316,6 +332950,8 @@ object.startedRunCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.startedRunCount = options.longs === String ? "0" : 0; + object.lastScheduledRunResponse = null; + object.updateTime = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -331364,6 +333000,10 @@ object.startedRunCount = options.longs === String ? String(message.startedRunCount) : message.startedRunCount; else object.startedRunCount = options.longs === String ? $util.Long.prototype.toString.call(message.startedRunCount) : options.longs === Number ? new $util.LongBits(message.startedRunCount.low >>> 0, message.startedRunCount.high >>> 0).toNumber() : message.startedRunCount; + if (message.lastScheduledRunResponse != null && message.hasOwnProperty("lastScheduledRunResponse")) + object.lastScheduledRunResponse = $root.google.cloud.aiplatform.v1beta1.Schedule.RunResponse.toObject(message.lastScheduledRunResponse, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; @@ -331393,6 +333033,238 @@ return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.Schedule"; }; + Schedule.RunResponse = (function() { + + /** + * Properties of a RunResponse. + * @memberof google.cloud.aiplatform.v1beta1.Schedule + * @interface IRunResponse + * @property {google.protobuf.ITimestamp|null} [scheduledRunTime] RunResponse scheduledRunTime + * @property {string|null} [runResponse] RunResponse runResponse + */ + + /** + * Constructs a new RunResponse. + * @memberof google.cloud.aiplatform.v1beta1.Schedule + * @classdesc Represents a RunResponse. + * @implements IRunResponse + * @constructor + * @param {google.cloud.aiplatform.v1beta1.Schedule.IRunResponse=} [properties] Properties to set + */ + function RunResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunResponse scheduledRunTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduledRunTime + * @memberof google.cloud.aiplatform.v1beta1.Schedule.RunResponse + * @instance + */ + RunResponse.prototype.scheduledRunTime = null; + + /** + * RunResponse runResponse. + * @member {string} runResponse + * @memberof google.cloud.aiplatform.v1beta1.Schedule.RunResponse + * @instance + */ + RunResponse.prototype.runResponse = ""; + + /** + * Creates a new RunResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.Schedule.RunResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.Schedule.IRunResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.Schedule.RunResponse} RunResponse instance + */ + RunResponse.create = function create(properties) { + return new RunResponse(properties); + }; + + /** + * Encodes the specified RunResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Schedule.RunResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.Schedule.RunResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.Schedule.IRunResponse} message RunResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scheduledRunTime != null && Object.hasOwnProperty.call(message, "scheduledRunTime")) + $root.google.protobuf.Timestamp.encode(message.scheduledRunTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.runResponse != null && Object.hasOwnProperty.call(message, "runResponse")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.runResponse); + return writer; + }; + + /** + * Encodes the specified RunResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Schedule.RunResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Schedule.RunResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.Schedule.IRunResponse} message RunResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.Schedule.RunResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.Schedule.RunResponse} RunResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.Schedule.RunResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scheduledRunTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.runResponse = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Schedule.RunResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.Schedule.RunResponse} RunResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.Schedule.RunResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scheduledRunTime != null && message.hasOwnProperty("scheduledRunTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.scheduledRunTime); + if (error) + return "scheduledRunTime." + error; + } + if (message.runResponse != null && message.hasOwnProperty("runResponse")) + if (!$util.isString(message.runResponse)) + return "runResponse: string expected"; + return null; + }; + + /** + * Creates a RunResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.Schedule.RunResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.Schedule.RunResponse} RunResponse + */ + RunResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.Schedule.RunResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.Schedule.RunResponse(); + if (object.scheduledRunTime != null) { + if (typeof object.scheduledRunTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Schedule.RunResponse.scheduledRunTime: object expected"); + message.scheduledRunTime = $root.google.protobuf.Timestamp.fromObject(object.scheduledRunTime); + } + if (object.runResponse != null) + message.runResponse = String(object.runResponse); + return message; + }; + + /** + * Creates a plain object from a RunResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.Schedule.RunResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.Schedule.RunResponse} message RunResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scheduledRunTime = null; + object.runResponse = ""; + } + if (message.scheduledRunTime != null && message.hasOwnProperty("scheduledRunTime")) + object.scheduledRunTime = $root.google.protobuf.Timestamp.toObject(message.scheduledRunTime, options); + if (message.runResponse != null && message.hasOwnProperty("runResponse")) + object.runResponse = message.runResponse; + return object; + }; + + /** + * Converts this RunResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.Schedule.RunResponse + * @instance + * @returns {Object.} JSON object + */ + RunResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.Schedule.RunResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.Schedule.RunResponse"; + }; + + return RunResponse; + })(); + /** * State enum. * @name google.cloud.aiplatform.v1beta1.Schedule.State diff --git a/packages/google-cloud-aiplatform/protos/protos.json b/packages/google-cloud-aiplatform/protos/protos.json index 63625ae0597..7aebb6ee86c 100644 --- a/packages/google-cloud-aiplatform/protos/protos.json +++ b/packages/google-cloud-aiplatform/protos/protos.json @@ -28,6 +28,7 @@ "NVIDIA_TESLA_P4": 4, "NVIDIA_TESLA_T4": 5, "NVIDIA_TESLA_A100": 8, + "NVIDIA_L4": 11, "TPU_V2": 6, "TPU_V3": 7, "TPU_V4_POD": 10 @@ -1769,7 +1770,8 @@ "AUTOML": 1, "CUSTOM": 2, "BQML": 3, - "MODEL_GARDEN": 4 + "MODEL_GARDEN": 4, + "GENIE": 5 } } } @@ -2025,6 +2027,22 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "experiment": { + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Context" + } + }, + "experimentRun": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Context" + } } } }, @@ -3404,7 +3422,7 @@ "Endpoint": { "options": { "(google.api.resource).type": "aiplatform.googleapis.com/Endpoint", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/endpoints/{endpoint}" + "(google.api.resource).pattern": "projects/{project}/locations/{location}/publishers/{publisher}/models/{model}" }, "fields": { "name": { @@ -3792,6 +3810,34 @@ } } ] + }, + "MutateDeployedModel": { + "requestType": "MutateDeployedModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{endpoint=projects/*/locations/*/endpoints/*}:mutateDeployedModel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "endpoint,deployed_model,update_mask", + "(google.longrunning.operation_info).response_type": "MutateDeployedModelResponse", + "(google.longrunning.operation_info).metadata_type": "MutateDeployedModelOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{endpoint=projects/*/locations/*/endpoints/*}:mutateDeployedModel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "endpoint,deployed_model,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MutateDeployedModelResponse", + "metadata_type": "MutateDeployedModelOperationMetadata" + } + } + ] } } }, @@ -4003,6 +4049,48 @@ } } }, + "MutateDeployedModelRequest": { + "fields": { + "endpoint": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Endpoint" + } + }, + "deployedModel": { + "type": "DeployedModel", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "MutateDeployedModelResponse": { + "fields": { + "deployedModel": { + "type": "DeployedModel", + "id": 1 + } + } + }, + "MutateDeployedModelOperationMetadata": { + "fields": { + "genericMetadata": { + "type": "GenericOperationMetadata", + "id": 1 + } + } + }, "EntityType": { "options": { "(google.api.resource).type": "aiplatform.googleapis.com/EntityType", @@ -4058,6 +4146,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "offlineStorageTtlDays": { + "type": "int32", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -4604,6 +4699,13 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "onlineStorageTtlDays": { + "type": "int32", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "encryptionSpec": { "type": "EncryptionSpec", "id": 10, @@ -15237,13 +15339,19 @@ "options": { "(google.api.http).post": "/v1/{endpoint=projects/*/locations/*/endpoints/*}:predict", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:predict", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "endpoint,instances,parameters" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1/{endpoint=projects/*/locations/*/endpoints/*}:predict", - "body": "*" + "body": "*", + "additional_bindings": { + "post": "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:predict", + "body": "*" + } } }, { @@ -15257,13 +15365,19 @@ "options": { "(google.api.http).post": "/v1/{endpoint=projects/*/locations/*/endpoints/*}:rawPredict", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:rawPredict", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "endpoint,http_body" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1/{endpoint=projects/*/locations/*/endpoints/*}:rawPredict", - "body": "*" + "body": "*", + "additional_bindings": { + "post": "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:rawPredict", + "body": "*" + } } }, { @@ -19172,6 +19286,7 @@ "NVIDIA_TESLA_T4": 5, "NVIDIA_TESLA_A100": 8, "NVIDIA_A100_80GB": 9, + "NVIDIA_L4": 11, "TPU_V2": 6, "TPU_V3": 7, "TPU_V4_POD": 10 @@ -21549,7 +21664,8 @@ "AUTOML": 1, "CUSTOM": 2, "BQML": 3, - "MODEL_GARDEN": 4 + "MODEL_GARDEN": 4, + "GENIE": 5 } } } @@ -21805,6 +21921,22 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "experiment": { + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Context" + } + }, + "experimentRun": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Context" + } } } }, @@ -23476,7 +23608,7 @@ "Endpoint": { "options": { "(google.api.resource).type": "aiplatform.googleapis.com/Endpoint", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/endpoints/{endpoint}" + "(google.api.resource).pattern": "projects/{project}/locations/{location}/publishers/{publisher}/models/{model}" }, "fields": { "name": { @@ -23876,6 +24008,34 @@ } } ] + }, + "MutateDeployedModel": { + "requestType": "MutateDeployedModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:mutateDeployedModel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "endpoint,deployed_model,update_mask", + "(google.longrunning.operation_info).response_type": "MutateDeployedModelResponse", + "(google.longrunning.operation_info).metadata_type": "MutateDeployedModelOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:mutateDeployedModel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "endpoint,deployed_model,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MutateDeployedModelResponse", + "metadata_type": "MutateDeployedModelOperationMetadata" + } + } + ] } } }, @@ -24083,6 +24243,48 @@ } } }, + "MutateDeployedModelRequest": { + "fields": { + "endpoint": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Endpoint" + } + }, + "deployedModel": { + "type": "DeployedModel", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "MutateDeployedModelResponse": { + "fields": { + "deployedModel": { + "type": "DeployedModel", + "id": 1 + } + } + }, + "MutateDeployedModelOperationMetadata": { + "fields": { + "genericMetadata": { + "type": "GenericOperationMetadata", + "id": 1 + } + } + }, "EntityType": { "options": { "(google.api.resource).type": "aiplatform.googleapis.com/EntityType", @@ -35092,13 +35294,19 @@ "options": { "(google.api.http).post": "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:predict", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:predict", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "endpoint,instances,parameters" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:predict", - "body": "*" + "body": "*", + "additional_bindings": { + "post": "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:predict", + "body": "*" + } } }, { @@ -35112,13 +35320,19 @@ "options": { "(google.api.http).post": "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:rawPredict", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:rawPredict", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "endpoint,http_body" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:rawPredict", - "body": "*" + "body": "*", + "additional_bindings": { + "post": "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:rawPredict", + "body": "*" + } } }, { @@ -35355,6 +35569,13 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "nextRunTime": { "type": "google.protobuf.Timestamp", "id": 7, @@ -35396,9 +35617,28 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "lastScheduledRunResponse": { + "type": "RunResponse", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { + "RunResponse": { + "fields": { + "scheduledRunTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "runResponse": { + "type": "string", + "id": 2 + } + } + }, "State": { "values": { "STATE_UNSPECIFIED": 0, @@ -35523,7 +35763,7 @@ "options": { "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/schedules/*}:resume", "(google.api.http).body": "*", - "(google.api.method_signature)": "name" + "(google.api.method_signature)": "name,catch_up" }, "parsedOptions": [ { @@ -35534,6 +35774,9 @@ }, { "(google.api.method_signature)": "name" + }, + { + "(google.api.method_signature)": "name,catch_up" } ] } diff --git a/packages/google-cloud-aiplatform/samples/README.md b/packages/google-cloud-aiplatform/samples/README.md index 278bc8c20cf..690ac4aa417 100644 --- a/packages/google-cloud-aiplatform/samples/README.md +++ b/packages/google-cloud-aiplatform/samples/README.md @@ -29,6 +29,7 @@ * [Endpoint_service.deploy_model](#endpoint_service.deploy_model) * [Endpoint_service.get_endpoint](#endpoint_service.get_endpoint) * [Endpoint_service.list_endpoints](#endpoint_service.list_endpoints) + * [Endpoint_service.mutate_deployed_model](#endpoint_service.mutate_deployed_model) * [Endpoint_service.undeploy_model](#endpoint_service.undeploy_model) * [Endpoint_service.update_endpoint](#endpoint_service.update_endpoint) * [Featurestore_online_serving_service.read_feature_values](#featurestore_online_serving_service.read_feature_values) @@ -240,6 +241,7 @@ * [Endpoint_service.deploy_model](#endpoint_service.deploy_model) * [Endpoint_service.get_endpoint](#endpoint_service.get_endpoint) * [Endpoint_service.list_endpoints](#endpoint_service.list_endpoints) + * [Endpoint_service.mutate_deployed_model](#endpoint_service.mutate_deployed_model) * [Endpoint_service.undeploy_model](#endpoint_service.undeploy_model) * [Endpoint_service.update_endpoint](#endpoint_service.update_endpoint) * [Featurestore_online_serving_service.read_feature_values](#featurestore_online_serving_service.read_feature_values) @@ -745,6 +747,23 @@ __Usage:__ +### Endpoint_service.mutate_deployed_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.mutate_deployed_model.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.mutate_deployed_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.mutate_deployed_model.js` + + +----- + + + + ### Endpoint_service.undeploy_model View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.undeploy_model.js). @@ -4332,6 +4351,23 @@ __Usage:__ +### Endpoint_service.mutate_deployed_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js` + + +----- + + + + ### Endpoint_service.undeploy_model View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.undeploy_model.js). diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.mutate_deployed_model.js b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.mutate_deployed_model.js similarity index 100% rename from owl-bot-staging/google-cloud-aiplatform/v1/samples/generated/v1/endpoint_service.mutate_deployed_model.js rename to packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.mutate_deployed_model.js diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_entity_type.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_entity_type.js index 9178e15569b..6ecbd8a7a60 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_entity_type.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_entity_type.js @@ -52,7 +52,7 @@ function main(entityType) { * * `monitoring_config.import_features_analysis.anomaly_detection_baseline` * * `monitoring_config.numerical_threshold_config.value` * * `monitoring_config.categorical_threshold_config.value` - * * `offline_storage_ttl_days` (available in Preview) + * * `offline_storage_ttl_days` */ // const updateMask = {} diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_featurestore.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_featurestore.js index 4b299d8bd77..9640bf48384 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_featurestore.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_featurestore.js @@ -46,7 +46,7 @@ function main(featurestore) { * * `labels` * * `online_serving_config.fixed_node_count` * * `online_serving_config.scaling` - * * `online_storage_ttl_days` (available in Preview) + * * `online_storage_ttl_days` */ // const updateMask = {} diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_versions.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_versions.js index 545e16c88bc..fdd0680bc50 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_versions.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_versions.js @@ -39,8 +39,10 @@ function main(name) { /** * 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. + * next_page_token google.cloud.aiplatform.v1.ListModelVersionsResponse.next_page_token + * of the previous + * ListModelVersions google.cloud.aiplatform.v1.ModelService.ListModelVersions + * call. */ // const pageToken = 'abc123' /** diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json index e3931c12f26..ca146dfea71 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json @@ -971,6 +971,54 @@ } } }, + { + "regionTag": "aiplatform_v1_generated_EndpointService_MutateDeployedModel_async", + "title": "DatasetService mutateDeployedModel Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing deployed model. Updatable fields include `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, `disable_container_logging` (v1 only), and `enable_container_logging` (v1beta1 only).", + "canonical": true, + "file": "endpoint_service.mutate_deployed_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MutateDeployedModel", + "fullName": "google.cloud.aiplatform.v1.EndpointService.MutateDeployedModel", + "async": true, + "parameters": [ + { + "name": "endpoint", + "type": "TYPE_STRING" + }, + { + "name": "deployed_model", + "type": ".google.cloud.aiplatform.v1.DeployedModel" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EndpointServiceClient", + "fullName": "google.cloud.aiplatform.v1.EndpointServiceClient" + }, + "method": { + "shortName": "MutateDeployedModel", + "fullName": "google.cloud.aiplatform.v1.EndpointService.MutateDeployedModel", + "service": { + "shortName": "EndpointService", + "fullName": "google.cloud.aiplatform.v1.EndpointService" + } + } + } + }, { "regionTag": "aiplatform_v1_generated_FeaturestoreOnlineServingService_ReadFeatureValues_async", "title": "DatasetService readFeatureValues Sample", @@ -6146,7 +6194,7 @@ "segments": [ { "start": 25, - "end": 90, + "end": 92, "type": "FULL" } ], diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.export_tensorboard_time_series_data.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.export_tensorboard_time_series_data.js index aecf725f5b4..3e1a343242b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.export_tensorboard_time_series_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.export_tensorboard_time_series_data.js @@ -46,11 +46,11 @@ function main(tensorboardTimeSeries) { // const pageSize = 1234 /** * A page token, received from a previous - * TensorboardService.ExportTensorboardTimeSeries call. - * Provide this to retrieve the subsequent page. + * ExportTensorboardTimeSeriesData google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData + * 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. + * ExportTensorboardTimeSeriesData google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData + * must match the call that provided the page token. */ // const pageToken = 'abc123' /** diff --git a/owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js similarity index 100% rename from owl-bot-staging/google-cloud-aiplatform/v1beta1/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js rename to packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_entity_type.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_entity_type.js index c44781a7d36..a5503fa556f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_entity_type.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_entity_type.js @@ -52,7 +52,7 @@ function main(entityType) { * * `monitoring_config.import_features_analysis.anomaly_detection_baseline` * * `monitoring_config.numerical_threshold_config.value` * * `monitoring_config.categorical_threshold_config.value` - * * `offline_storage_ttl_days` (available in Preview) + * * `offline_storage_ttl_days` */ // const updateMask = {} diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_featurestore.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_featurestore.js index 00871b21570..ba70ae7a4b9 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_featurestore.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_featurestore.js @@ -46,7 +46,7 @@ function main(featurestore) { * * `labels` * * `online_serving_config.fixed_node_count` * * `online_serving_config.scaling` - * * `online_storage_ttl_days` (available in Preview) + * * `online_storage_ttl_days` */ // const updateMask = {} diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/match_service.find_neighbors.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/match_service.find_neighbors.js index a59431e2e8d..4de8b881880 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/match_service.find_neighbors.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/match_service.find_neighbors.js @@ -35,7 +35,7 @@ function main(indexEndpoint) { */ // const indexEndpoint = 'abc123' /** - * The ID of the DeploydIndex that will serve the request. This request is + * The ID of the DeployedIndex that will serve the request. This request is * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index * has a DeployedIndex.id field. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/match_service.read_index_datapoints.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/match_service.read_index_datapoints.js index 0b8bd4d4fc6..2ca65a32959 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/match_service.read_index_datapoints.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/match_service.read_index_datapoints.js @@ -35,7 +35,7 @@ function main(indexEndpoint) { */ // const indexEndpoint = 'abc123' /** - * The ID of the DeploydIndex that will serve the request. + * The ID of the DeployedIndex that will serve the request. */ // const deployedIndexId = 'abc123' /** diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_versions.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_versions.js index c39d7342c70..10f0e2d46c7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_versions.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_versions.js @@ -39,8 +39,10 @@ function main(name) { /** * 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. + * next_page_token google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token + * of the previous + * ListModelVersions google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions + * call. */ // const pageToken = 'abc123' /** diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json b/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json index 4df54038b1c..c9090f383f3 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json @@ -1191,6 +1191,54 @@ } } }, + { + "regionTag": "aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_async", + "title": "DatasetService mutateDeployedModel Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing deployed model. Updatable fields include `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, `disable_container_logging` (v1 only), and `enable_container_logging` (v1beta1 only).", + "canonical": true, + "file": "endpoint_service.mutate_deployed_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MutateDeployedModel", + "fullName": "google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModel", + "async": true, + "parameters": [ + { + "name": "endpoint", + "type": "TYPE_STRING" + }, + { + "name": "deployed_model", + "type": ".google.cloud.aiplatform.v1beta1.DeployedModel" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EndpointServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.EndpointServiceClient" + }, + "method": { + "shortName": "MutateDeployedModel", + "fullName": "google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModel", + "service": { + "shortName": "EndpointService", + "fullName": "google.cloud.aiplatform.v1beta1.EndpointService" + } + } + } + }, { "regionTag": "aiplatform_v1beta1_generated_FeaturestoreOnlineServingService_ReadFeatureValues_async", "title": "DatasetService readFeatureValues Sample", @@ -6462,7 +6510,7 @@ "segments": [ { "start": 25, - "end": 90, + "end": 92, "type": "FULL" } ], diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.js index 2b0d787398c..7aa7c25d623 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.js @@ -46,11 +46,11 @@ function main(tensorboardTimeSeries) { // const pageSize = 1234 /** * A page token, received from a previous - * TensorboardService.ExportTensorboardTimeSeries call. - * Provide this to retrieve the subsequent page. + * ExportTensorboardTimeSeriesData google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData + * 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. + * ExportTensorboardTimeSeriesData google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData + * must match the call that provided the page token. */ // const pageToken = 'abc123' /** diff --git a/packages/google-cloud-aiplatform/src/v1/dataset_service_client.ts b/packages/google-cloud-aiplatform/src/v1/dataset_service_client.ts index 448b46251b4..84d7977eaf1 100644 --- a/packages/google-cloud-aiplatform/src/v1/dataset_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/dataset_service_client.ts @@ -218,9 +218,6 @@ export class DatasetServiceClient { 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}' ), @@ -273,6 +270,13 @@ export class DatasetServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -370,6 +374,12 @@ export class DatasetServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -393,6 +403,14 @@ export class DatasetServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -411,6 +429,12 @@ export class DatasetServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -4648,55 +4672,6 @@ export class DatasetServiceClient { 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. * @@ -5761,6 +5736,154 @@ export class DatasetServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/endpoint_service_client.ts b/packages/google-cloud-aiplatform/src/v1/endpoint_service_client.ts index b4d25631d04..3df5eb15641 100644 --- a/packages/google-cloud-aiplatform/src/v1/endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/endpoint_service_client.ts @@ -217,9 +217,6 @@ export class EndpointServiceClient { 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}' ), @@ -272,6 +269,13 @@ export class EndpointServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -349,6 +353,12 @@ export class EndpointServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -372,6 +382,14 @@ export class EndpointServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -390,6 +408,12 @@ export class EndpointServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -1347,6 +1371,12 @@ export class EndpointServiceClient { const undeployModelMetadata = protoFilesRoot.lookup( '.google.cloud.aiplatform.v1.UndeployModelOperationMetadata' ) as gax.protobuf.Type; + const mutateDeployedModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.MutateDeployedModelResponse' + ) as gax.protobuf.Type; + const mutateDeployedModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createEndpoint: new this._gaxModule.LongrunningDescriptor( @@ -1369,6 +1399,11 @@ export class EndpointServiceClient { undeployModelResponse.decode.bind(undeployModelResponse), undeployModelMetadata.decode.bind(undeployModelMetadata) ), + mutateDeployedModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + mutateDeployedModelResponse.decode.bind(mutateDeployedModelResponse), + mutateDeployedModelMetadata.decode.bind(mutateDeployedModelMetadata) + ), }; // Put together the default options sent with requests. @@ -1428,6 +1463,7 @@ export class EndpointServiceClient { 'deleteEndpoint', 'deployModel', 'undeployModel', + 'mutateDeployedModel', ]; for (const methodName of endpointServiceStubMethods) { const callPromise = this.endpointServiceStub.then( @@ -2303,6 +2339,165 @@ export class EndpointServiceClient { protos.google.cloud.aiplatform.v1.UndeployModelOperationMetadata >; } + /** + * Updates an existing deployed model. Updatable fields include + * `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, + * `disable_container_logging` (v1 only), and `enable_container_logging` + * (v1beta1 only). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.endpoint + * Required. The name of the Endpoint resource into which to mutate a + * DeployedModel. Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {google.cloud.aiplatform.v1.DeployedModel} request.deployedModel + * Required. The DeployedModel to be mutated within the Endpoint. Only the + * following fields can be mutated: + * + * * `min_replica_count` in either + * {@link google.cloud.aiplatform.v1.DedicatedResources|DedicatedResources} or + * {@link google.cloud.aiplatform.v1.AutomaticResources|AutomaticResources} + * * `max_replica_count` in either + * {@link google.cloud.aiplatform.v1.DedicatedResources|DedicatedResources} or + * {@link google.cloud.aiplatform.v1.AutomaticResources|AutomaticResources} + * * {@link google.cloud.aiplatform.v1.DedicatedResources.autoscaling_metric_specs|autoscaling_metric_specs} + * * `disable_container_logging` (v1 only) + * * `enable_container_logging` (v1beta1 only) + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://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_MutateDeployedModel_async + */ + mutateDeployedModel( + request?: protos.google.cloud.aiplatform.v1.IMutateDeployedModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.IMutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1.IMutateDeployedModelOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + mutateDeployedModel( + request: protos.google.cloud.aiplatform.v1.IMutateDeployedModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IMutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1.IMutateDeployedModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + mutateDeployedModel( + request: protos.google.cloud.aiplatform.v1.IMutateDeployedModelRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IMutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1.IMutateDeployedModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + mutateDeployedModel( + request?: protos.google.cloud.aiplatform.v1.IMutateDeployedModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IMutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1.IMutateDeployedModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IMutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1.IMutateDeployedModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.IMutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1.IMutateDeployedModelOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.mutateDeployedModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `mutateDeployedModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://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_MutateDeployedModel_async + */ + async checkMutateDeployedModelProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1.MutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata + > + > { + 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.mutateDeployedModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1.MutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1.MutateDeployedModelOperationMetadata + >; + } /** * Lists Endpoints in a Location. * @@ -3579,55 +3774,6 @@ export class EndpointServiceClient { 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. * @@ -4692,6 +4838,154 @@ export class EndpointServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/endpoint_service_client_config.json b/packages/google-cloud-aiplatform/src/v1/endpoint_service_client_config.json index 0c101562215..24f529b92ba 100644 --- a/packages/google-cloud-aiplatform/src/v1/endpoint_service_client_config.json +++ b/packages/google-cloud-aiplatform/src/v1/endpoint_service_client_config.json @@ -47,6 +47,10 @@ "UndeployModel": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "MutateDeployedModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_client.ts b/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_client.ts index 9fe9ebebc16..3e82ff84d76 100644 --- a/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_client.ts @@ -213,9 +213,6 @@ export class FeaturestoreOnlineServingServiceClient { 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}' ), @@ -265,6 +262,13 @@ export class FeaturestoreOnlineServingServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -1516,55 +1520,6 @@ export class FeaturestoreOnlineServingServiceClient { 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. * @@ -2593,6 +2548,154 @@ export class FeaturestoreOnlineServingServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/featurestore_service_client.ts b/packages/google-cloud-aiplatform/src/v1/featurestore_service_client.ts index 576ad29fd71..84b8f60a560 100644 --- a/packages/google-cloud-aiplatform/src/v1/featurestore_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/featurestore_service_client.ts @@ -217,9 +217,6 @@ export class FeaturestoreServiceClient { 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}' ), @@ -275,6 +272,13 @@ export class FeaturestoreServiceClient { projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -367,6 +371,12 @@ export class FeaturestoreServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -390,6 +400,14 @@ export class FeaturestoreServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -408,6 +426,12 @@ export class FeaturestoreServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -1851,7 +1875,7 @@ export class FeaturestoreServiceClient { * * `monitoring_config.import_features_analysis.anomaly_detection_baseline` * * `monitoring_config.numerical_threshold_config.value` * * `monitoring_config.categorical_threshold_config.value` - * * `offline_storage_ttl_days` (available in Preview) + * * `offline_storage_ttl_days` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2305,7 +2329,7 @@ export class FeaturestoreServiceClient { * * `labels` * * `online_serving_config.fixed_node_count` * * `online_serving_config.scaling` - * * `online_storage_ttl_days` (available in Preview) + * * `online_storage_ttl_days` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -6349,55 +6373,6 @@ export class FeaturestoreServiceClient { 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. * @@ -7485,6 +7460,154 @@ export class FeaturestoreServiceClient { return this.pathTemplates.projectPathTemplate.match(projectName).project; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json b/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json index 6c2ef2e22bf..ead7be93841 100644 --- a/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json +++ b/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json @@ -194,6 +194,11 @@ "undeployModel" ] }, + "MutateDeployedModel": { + "methods": [ + "mutateDeployedModel" + ] + }, "ListEndpoints": { "methods": [ "listEndpoints", @@ -236,6 +241,11 @@ "undeployModel" ] }, + "MutateDeployedModel": { + "methods": [ + "mutateDeployedModel" + ] + }, "ListEndpoints": { "methods": [ "listEndpoints", diff --git a/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_client.ts b/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_client.ts index 5b183db9294..6465c6ef1d6 100644 --- a/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_client.ts @@ -217,9 +217,6 @@ export class IndexEndpointServiceClient { 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}' ), @@ -272,6 +269,13 @@ export class IndexEndpointServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -349,6 +353,12 @@ export class IndexEndpointServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -372,6 +382,14 @@ export class IndexEndpointServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -390,6 +408,12 @@ export class IndexEndpointServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -3682,55 +3706,6 @@ export class IndexEndpointServiceClient { 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. * @@ -4795,6 +4770,154 @@ export class IndexEndpointServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/index_service_client.ts b/packages/google-cloud-aiplatform/src/v1/index_service_client.ts index 042979407c9..b198cbb12f0 100644 --- a/packages/google-cloud-aiplatform/src/v1/index_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/index_service_client.ts @@ -217,9 +217,6 @@ export class IndexServiceClient { 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}' ), @@ -272,6 +269,13 @@ export class IndexServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -349,6 +353,12 @@ export class IndexServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -372,6 +382,14 @@ export class IndexServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -390,6 +408,12 @@ export class IndexServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -3403,55 +3427,6 @@ export class IndexServiceClient { 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. * @@ -4516,6 +4491,154 @@ export class IndexServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/job_service_client.ts b/packages/google-cloud-aiplatform/src/v1/job_service_client.ts index 768030cb6cc..a2d11f61a18 100644 --- a/packages/google-cloud-aiplatform/src/v1/job_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/job_service_client.ts @@ -217,9 +217,6 @@ export class JobServiceClient { 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}' ), @@ -272,6 +269,13 @@ export class JobServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -385,6 +389,12 @@ export class JobServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -408,6 +418,14 @@ export class JobServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -426,6 +444,12 @@ export class JobServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -7783,55 +7807,6 @@ export class JobServiceClient { 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. * @@ -8896,6 +8871,154 @@ export class JobServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/metadata_service_client.ts b/packages/google-cloud-aiplatform/src/v1/metadata_service_client.ts index 4ae2a70c2b6..292ead32f7c 100644 --- a/packages/google-cloud-aiplatform/src/v1/metadata_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/metadata_service_client.ts @@ -217,9 +217,6 @@ export class MetadataServiceClient { 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}' ), @@ -275,6 +272,13 @@ export class MetadataServiceClient { projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -372,6 +376,12 @@ export class MetadataServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -395,6 +405,14 @@ export class MetadataServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -413,6 +431,12 @@ export class MetadataServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -7131,55 +7155,6 @@ export class MetadataServiceClient { 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. * @@ -8267,6 +8242,154 @@ export class MetadataServiceClient { return this.pathTemplates.projectPathTemplate.match(projectName).project; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/migration_service_client.ts b/packages/google-cloud-aiplatform/src/v1/migration_service_client.ts index 4830a3a51c7..04751f12c38 100644 --- a/packages/google-cloud-aiplatform/src/v1/migration_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/migration_service_client.ts @@ -218,9 +218,6 @@ export class MigrationServiceClient { 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}' ), @@ -273,6 +270,13 @@ export class MigrationServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -350,6 +354,12 @@ export class MigrationServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -373,6 +383,14 @@ export class MigrationServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -391,6 +409,12 @@ export class MigrationServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -2855,55 +2879,6 @@ export class MigrationServiceClient { 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. * @@ -3968,6 +3943,154 @@ export class MigrationServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/model_service_client.ts b/packages/google-cloud-aiplatform/src/v1/model_service_client.ts index 34b80bd913b..ac76d3921a2 100644 --- a/packages/google-cloud-aiplatform/src/v1/model_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/model_service_client.ts @@ -217,9 +217,6 @@ export class ModelServiceClient { 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}' ), @@ -272,6 +269,13 @@ export class ModelServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -364,6 +368,12 @@ export class ModelServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -387,6 +397,14 @@ export class ModelServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -405,6 +423,12 @@ export class ModelServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -3424,8 +3448,10 @@ export class ModelServiceClient { * @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. + * {@link google.cloud.aiplatform.v1.ListModelVersionsResponse.next_page_token|next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1.ModelService.ListModelVersions|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. @@ -3548,8 +3574,10 @@ export class ModelServiceClient { * @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. + * {@link google.cloud.aiplatform.v1.ListModelVersionsResponse.next_page_token|next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1.ModelService.ListModelVersions|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. @@ -3620,8 +3648,10 @@ export class ModelServiceClient { * @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. + * {@link google.cloud.aiplatform.v1.ListModelVersionsResponse.next_page_token|next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1.ModelService.ListModelVersions|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. @@ -5115,55 +5145,6 @@ export class ModelServiceClient { 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. * @@ -6228,6 +6209,154 @@ export class ModelServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/pipeline_service_client.ts b/packages/google-cloud-aiplatform/src/v1/pipeline_service_client.ts index eb362f3b242..dc2e8201118 100644 --- a/packages/google-cloud-aiplatform/src/v1/pipeline_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/pipeline_service_client.ts @@ -219,9 +219,6 @@ export class PipelineServiceClient { 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}' ), @@ -274,6 +271,13 @@ export class PipelineServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -356,6 +360,12 @@ export class PipelineServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -379,6 +389,14 @@ export class PipelineServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -397,6 +415,12 @@ export class PipelineServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -4025,55 +4049,6 @@ export class PipelineServiceClient { 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. * @@ -5138,6 +5113,154 @@ export class PipelineServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/prediction_service_client.ts b/packages/google-cloud-aiplatform/src/v1/prediction_service_client.ts index b5318a426e4..3acab4bb4a1 100644 --- a/packages/google-cloud-aiplatform/src/v1/prediction_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/prediction_service_client.ts @@ -212,9 +212,6 @@ export class PredictionServiceClient { 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}' ), @@ -264,6 +261,13 @@ export class PredictionServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -1575,55 +1579,6 @@ export class PredictionServiceClient { 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. * @@ -2652,6 +2607,154 @@ export class PredictionServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_client.ts b/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_client.ts index 2ee979789a1..64919e2a7ed 100644 --- a/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_client.ts @@ -223,9 +223,6 @@ export class SpecialistPoolServiceClient { 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}' ), @@ -278,6 +275,13 @@ export class SpecialistPoolServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -355,6 +359,12 @@ export class SpecialistPoolServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -378,6 +388,14 @@ export class SpecialistPoolServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -396,6 +414,12 @@ export class SpecialistPoolServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -3224,55 +3248,6 @@ export class SpecialistPoolServiceClient { 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. * @@ -4337,6 +4312,154 @@ export class SpecialistPoolServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts b/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts index 7ac9057ecd7..979a93ac6ca 100644 --- a/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts @@ -217,9 +217,6 @@ export class TensorboardServiceClient { 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}' ), @@ -275,6 +272,13 @@ export class TensorboardServiceClient { projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -381,6 +385,12 @@ export class TensorboardServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -404,6 +414,14 @@ export class TensorboardServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -422,6 +440,12 @@ export class TensorboardServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -5308,12 +5332,12 @@ export class TensorboardServiceClient { * Values above 10000 are 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. + * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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. + * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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 is returned in a pseudo random @@ -5426,12 +5450,12 @@ export class TensorboardServiceClient { * Values above 10000 are 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. + * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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. + * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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 is returned in a pseudo random @@ -5489,12 +5513,12 @@ export class TensorboardServiceClient { * Values above 10000 are 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. + * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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. + * {@link google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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 is returned in a pseudo random @@ -6519,55 +6543,6 @@ export class TensorboardServiceClient { 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. * @@ -7655,6 +7630,154 @@ export class TensorboardServiceClient { return this.pathTemplates.projectPathTemplate.match(projectName).project; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/vizier_service_client.ts b/packages/google-cloud-aiplatform/src/v1/vizier_service_client.ts index 1349db1c941..1794a94a3c3 100644 --- a/packages/google-cloud-aiplatform/src/v1/vizier_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/vizier_service_client.ts @@ -221,9 +221,6 @@ export class VizierServiceClient { 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}' ), @@ -276,6 +273,13 @@ export class VizierServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -358,6 +362,12 @@ export class VizierServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -381,6 +391,14 @@ export class VizierServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -399,6 +417,12 @@ export class VizierServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -4169,55 +4193,6 @@ export class VizierServiceClient { 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. * @@ -5282,6 +5257,154 @@ export class VizierServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts index d58c1fe46f1..123fd066442 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts @@ -221,9 +221,6 @@ export class DatasetServiceClient { 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}' ), @@ -276,6 +273,13 @@ export class DatasetServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -373,6 +377,12 @@ export class DatasetServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -382,6 +392,12 @@ export class DatasetServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -397,6 +413,14 @@ export class DatasetServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -409,6 +433,14 @@ export class DatasetServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -422,6 +454,12 @@ export class DatasetServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -431,6 +469,12 @@ export class DatasetServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -885,6 +929,14 @@ export class DatasetServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1072,6 +1124,12 @@ export class DatasetServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1250,6 +1308,12 @@ export class DatasetServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, ], }, { @@ -1446,6 +1510,12 @@ export class DatasetServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, ], }, ]; @@ -4834,55 +4904,6 @@ export class DatasetServiceClient { ).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. * @@ -5947,6 +5968,154 @@ export class DatasetServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts index 7ca3e00ceac..f5696f646f2 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts @@ -221,9 +221,6 @@ export class DeploymentResourcePoolServiceClient { 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}' ), @@ -279,6 +276,13 @@ export class DeploymentResourcePoolServiceClient { projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -361,6 +365,12 @@ export class DeploymentResourcePoolServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -370,6 +380,12 @@ export class DeploymentResourcePoolServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -385,6 +401,14 @@ export class DeploymentResourcePoolServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -397,6 +421,14 @@ export class DeploymentResourcePoolServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -410,6 +442,12 @@ export class DeploymentResourcePoolServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -419,6 +457,12 @@ export class DeploymentResourcePoolServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -873,6 +917,14 @@ export class DeploymentResourcePoolServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1060,6 +1112,12 @@ export class DeploymentResourcePoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1238,6 +1296,12 @@ export class DeploymentResourcePoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, ], }, { @@ -1434,6 +1498,12 @@ export class DeploymentResourcePoolServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, ], }, ]; @@ -3494,55 +3564,6 @@ export class DeploymentResourcePoolServiceClient { ).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. * @@ -4630,6 +4651,154 @@ export class DeploymentResourcePoolServiceClient { return this.pathTemplates.projectPathTemplate.match(projectName).project; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts index 5b0e3458453..8f8813db7fc 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts @@ -220,9 +220,6 @@ export class EndpointServiceClient { 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}' ), @@ -275,6 +272,13 @@ export class EndpointServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -352,6 +356,12 @@ export class EndpointServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -361,6 +371,12 @@ export class EndpointServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -376,6 +392,14 @@ export class EndpointServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -388,6 +412,14 @@ export class EndpointServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -401,6 +433,12 @@ export class EndpointServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -410,6 +448,12 @@ export class EndpointServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -864,6 +908,14 @@ export class EndpointServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1051,6 +1103,12 @@ export class EndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1229,6 +1287,12 @@ export class EndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, ], }, { @@ -1425,6 +1489,12 @@ export class EndpointServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, ], }, ]; @@ -1456,6 +1526,12 @@ export class EndpointServiceClient { const undeployModelMetadata = protoFilesRoot.lookup( '.google.cloud.aiplatform.v1beta1.UndeployModelOperationMetadata' ) as gax.protobuf.Type; + const mutateDeployedModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse' + ) as gax.protobuf.Type; + const mutateDeployedModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createEndpoint: new this._gaxModule.LongrunningDescriptor( @@ -1478,6 +1554,11 @@ export class EndpointServiceClient { undeployModelResponse.decode.bind(undeployModelResponse), undeployModelMetadata.decode.bind(undeployModelMetadata) ), + mutateDeployedModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + mutateDeployedModelResponse.decode.bind(mutateDeployedModelResponse), + mutateDeployedModelMetadata.decode.bind(mutateDeployedModelMetadata) + ), }; // Put together the default options sent with requests. @@ -1537,6 +1618,7 @@ export class EndpointServiceClient { 'deleteEndpoint', 'deployModel', 'undeployModel', + 'mutateDeployedModel', ]; for (const methodName of endpointServiceStubMethods) { const callPromise = this.endpointServiceStub.then( @@ -2418,6 +2500,165 @@ export class EndpointServiceClient { protos.google.cloud.aiplatform.v1beta1.UndeployModelOperationMetadata >; } + /** + * Updates an existing deployed model. Updatable fields include + * `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, + * `disable_container_logging` (v1 only), and `enable_container_logging` + * (v1beta1 only). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.endpoint + * Required. The name of the Endpoint resource into which to mutate a + * DeployedModel. Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {google.cloud.aiplatform.v1beta1.DeployedModel} request.deployedModel + * Required. The DeployedModel to be mutated within the Endpoint. Only the + * following fields can be mutated: + * + * * `min_replica_count` in either + * {@link google.cloud.aiplatform.v1beta1.DedicatedResources|DedicatedResources} or + * {@link google.cloud.aiplatform.v1beta1.AutomaticResources|AutomaticResources} + * * `max_replica_count` in either + * {@link google.cloud.aiplatform.v1beta1.DedicatedResources|DedicatedResources} or + * {@link google.cloud.aiplatform.v1beta1.AutomaticResources|AutomaticResources} + * * {@link google.cloud.aiplatform.v1beta1.DedicatedResources.autoscaling_metric_specs|autoscaling_metric_specs} + * * `disable_container_logging` (v1 only) + * * `enable_container_logging` (v1beta1 only) + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://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_MutateDeployedModel_async + */ + mutateDeployedModel( + request?: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + mutateDeployedModel( + request: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + mutateDeployedModel( + request: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + mutateDeployedModel( + request?: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.mutateDeployedModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `mutateDeployedModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://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_MutateDeployedModel_async + */ + async checkMutateDeployedModelProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata + > + > { + 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.mutateDeployedModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1beta1.MutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1beta1.MutateDeployedModelOperationMetadata + >; + } /** * Lists Endpoints in a Location. * @@ -3732,55 +3973,6 @@ export class EndpointServiceClient { ).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. * @@ -4845,6 +5037,154 @@ export class EndpointServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client_config.json b/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client_config.json index 4775abb5f33..25b4f7170d1 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client_config.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client_config.json @@ -54,6 +54,10 @@ "timeout_millis": 5000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "MutateDeployedModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_client.ts index ebdf48c61d5..cd079b0ea43 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_client.ts @@ -216,9 +216,6 @@ export class FeaturestoreOnlineServingServiceClient { 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}' ), @@ -268,6 +265,13 @@ export class FeaturestoreOnlineServingServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -1599,55 +1603,6 @@ export class FeaturestoreOnlineServingServiceClient { ).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. * @@ -2676,6 +2631,154 @@ export class FeaturestoreOnlineServingServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts index 10aeb01175e..cf0f5985f99 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts @@ -220,9 +220,6 @@ export class FeaturestoreServiceClient { 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}' ), @@ -278,6 +275,13 @@ export class FeaturestoreServiceClient { projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -370,6 +374,12 @@ export class FeaturestoreServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -379,6 +389,12 @@ export class FeaturestoreServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -394,6 +410,14 @@ export class FeaturestoreServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -406,6 +430,14 @@ export class FeaturestoreServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -419,6 +451,12 @@ export class FeaturestoreServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -428,6 +466,12 @@ export class FeaturestoreServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -882,6 +926,14 @@ export class FeaturestoreServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1069,6 +1121,12 @@ export class FeaturestoreServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1247,6 +1305,12 @@ export class FeaturestoreServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, ], }, { @@ -1443,6 +1507,12 @@ export class FeaturestoreServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, ], }, ]; @@ -1967,7 +2037,7 @@ export class FeaturestoreServiceClient { * * `monitoring_config.import_features_analysis.anomaly_detection_baseline` * * `monitoring_config.numerical_threshold_config.value` * * `monitoring_config.categorical_threshold_config.value` - * * `offline_storage_ttl_days` (available in Preview) + * * `offline_storage_ttl_days` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2433,7 +2503,7 @@ export class FeaturestoreServiceClient { * * `labels` * * `online_serving_config.fixed_node_count` * * `online_serving_config.scaling` - * * `online_storage_ttl_days` (available in Preview) + * * `online_storage_ttl_days` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -6542,55 +6612,6 @@ export class FeaturestoreServiceClient { ).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. * @@ -7678,6 +7699,154 @@ export class FeaturestoreServiceClient { return this.pathTemplates.projectPathTemplate.match(projectName).project; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json b/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json index 283ed5b2e87..a2478c9f558 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json @@ -266,6 +266,11 @@ "undeployModel" ] }, + "MutateDeployedModel": { + "methods": [ + "mutateDeployedModel" + ] + }, "ListEndpoints": { "methods": [ "listEndpoints", @@ -308,6 +313,11 @@ "undeployModel" ] }, + "MutateDeployedModel": { + "methods": [ + "mutateDeployedModel" + ] + }, "ListEndpoints": { "methods": [ "listEndpoints", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts index 07e8b4a16f0..973aec43e19 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts @@ -220,9 +220,6 @@ export class IndexEndpointServiceClient { 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}' ), @@ -275,6 +272,13 @@ export class IndexEndpointServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -352,6 +356,12 @@ export class IndexEndpointServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -361,6 +371,12 @@ export class IndexEndpointServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -376,6 +392,14 @@ export class IndexEndpointServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -388,6 +412,14 @@ export class IndexEndpointServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -401,6 +433,12 @@ export class IndexEndpointServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -410,6 +448,12 @@ export class IndexEndpointServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -864,6 +908,14 @@ export class IndexEndpointServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1051,6 +1103,12 @@ export class IndexEndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1229,6 +1287,12 @@ export class IndexEndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, ], }, { @@ -1425,6 +1489,12 @@ export class IndexEndpointServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, ], }, ]; @@ -3869,55 +3939,6 @@ export class IndexEndpointServiceClient { ).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. * @@ -4982,6 +5003,154 @@ export class IndexEndpointServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts index c8d200ac96e..2c356046d1c 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts @@ -220,9 +220,6 @@ export class IndexServiceClient { 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}' ), @@ -275,6 +272,13 @@ export class IndexServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -352,6 +356,12 @@ export class IndexServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -361,6 +371,12 @@ export class IndexServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -376,6 +392,14 @@ export class IndexServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -388,6 +412,14 @@ export class IndexServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -401,6 +433,12 @@ export class IndexServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -410,6 +448,12 @@ export class IndexServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -864,6 +908,14 @@ export class IndexServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1051,6 +1103,12 @@ export class IndexServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1229,6 +1287,12 @@ export class IndexServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, ], }, { @@ -1425,6 +1489,12 @@ export class IndexServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, ], }, ]; @@ -3603,55 +3673,6 @@ export class IndexServiceClient { ).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. * @@ -4716,6 +4737,154 @@ export class IndexServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts index 7596bed4708..29999f6dd6e 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts @@ -220,9 +220,6 @@ export class JobServiceClient { 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}' ), @@ -275,6 +272,13 @@ export class JobServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -388,6 +392,12 @@ export class JobServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -397,6 +407,12 @@ export class JobServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -412,6 +428,14 @@ export class JobServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -424,6 +448,14 @@ export class JobServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -437,6 +469,12 @@ export class JobServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -446,6 +484,12 @@ export class JobServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -900,6 +944,14 @@ export class JobServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1087,6 +1139,12 @@ export class JobServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1265,6 +1323,12 @@ export class JobServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, ], }, { @@ -1461,6 +1525,12 @@ export class JobServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, ], }, ]; @@ -8011,55 +8081,6 @@ export class JobServiceClient { ).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. * @@ -9124,6 +9145,154 @@ export class JobServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/match_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/match_service_client.ts index 269d62d7255..cca3fc2c624 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/match_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/match_service_client.ts @@ -216,9 +216,6 @@ export class MatchServiceClient { 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}' ), @@ -268,6 +265,13 @@ export class MatchServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -442,7 +446,7 @@ export class MatchServiceClient { * Format: * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` * @param {string} request.deployedIndexId - * The ID of the DeploydIndex that will serve the request. This request is + * The ID of the DeployedIndex that will serve the request. This request is * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index * has a DeployedIndex.id field. @@ -550,7 +554,7 @@ export class MatchServiceClient { * Format: * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` * @param {string} request.deployedIndexId - * The ID of the DeploydIndex that will serve the request. + * The ID of the DeployedIndex that will serve the request. * @param {string[]} request.ids * IDs of the datapoints to be searched for. * @param {object} [options] @@ -1519,55 +1523,6 @@ export class MatchServiceClient { ).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. * @@ -2596,6 +2551,154 @@ export class MatchServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts index 129f03143ed..bb2fade6bba 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts @@ -220,9 +220,6 @@ export class MetadataServiceClient { 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}' ), @@ -278,6 +275,13 @@ export class MetadataServiceClient { projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -375,6 +379,12 @@ export class MetadataServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -384,6 +394,12 @@ export class MetadataServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -399,6 +415,14 @@ export class MetadataServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -411,6 +435,14 @@ export class MetadataServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -424,6 +456,12 @@ export class MetadataServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -433,6 +471,12 @@ export class MetadataServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -887,6 +931,14 @@ export class MetadataServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1074,6 +1126,12 @@ export class MetadataServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1252,6 +1310,12 @@ export class MetadataServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, ], }, { @@ -1448,6 +1512,12 @@ export class MetadataServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, ], }, ]; @@ -7362,55 +7432,6 @@ export class MetadataServiceClient { ).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. * @@ -8498,6 +8519,154 @@ export class MetadataServiceClient { return this.pathTemplates.projectPathTemplate.match(projectName).project; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts index 8013d46fba5..cebd52c5b73 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts @@ -221,9 +221,6 @@ export class MigrationServiceClient { 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}' ), @@ -276,6 +273,13 @@ export class MigrationServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -353,6 +357,12 @@ export class MigrationServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -362,6 +372,12 @@ export class MigrationServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -377,6 +393,14 @@ export class MigrationServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -389,6 +413,14 @@ export class MigrationServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -402,6 +434,12 @@ export class MigrationServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -411,6 +449,12 @@ export class MigrationServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -865,6 +909,14 @@ export class MigrationServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1052,6 +1104,12 @@ export class MigrationServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1230,6 +1288,12 @@ export class MigrationServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, ], }, { @@ -1426,6 +1490,12 @@ export class MigrationServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, ], }, ]; @@ -3033,55 +3103,6 @@ export class MigrationServiceClient { ).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. * @@ -4146,6 +4167,154 @@ export class MigrationServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts index 2f6259b9e03..cab3d869eef 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts @@ -220,9 +220,6 @@ export class ModelServiceClient { 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}' ), @@ -275,6 +272,13 @@ export class ModelServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -367,6 +371,12 @@ export class ModelServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -376,6 +386,12 @@ export class ModelServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -391,6 +407,14 @@ export class ModelServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -403,6 +427,14 @@ export class ModelServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -416,6 +448,12 @@ export class ModelServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -425,6 +463,12 @@ export class ModelServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -879,6 +923,14 @@ export class ModelServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1066,6 +1118,12 @@ export class ModelServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1244,6 +1302,12 @@ export class ModelServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, ], }, { @@ -1440,6 +1504,12 @@ export class ModelServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, ], }, ]; @@ -3696,8 +3766,10 @@ export class ModelServiceClient { * @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. + * {@link google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token|next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions|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. @@ -3820,8 +3892,10 @@ export class ModelServiceClient { * @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. + * {@link google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token|next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions|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. @@ -3892,8 +3966,10 @@ export class ModelServiceClient { * @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. + * {@link google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token|next_page_token} + * of the previous + * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions|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. @@ -5452,55 +5528,6 @@ export class ModelServiceClient { ).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. * @@ -6565,6 +6592,154 @@ export class ModelServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts index 4da4aeb027e..7e866c2f76b 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts @@ -222,9 +222,6 @@ export class PipelineServiceClient { 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}' ), @@ -277,6 +274,13 @@ export class PipelineServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -359,6 +363,12 @@ export class PipelineServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -368,6 +378,12 @@ export class PipelineServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -383,6 +399,14 @@ export class PipelineServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -395,6 +419,14 @@ export class PipelineServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -408,6 +440,12 @@ export class PipelineServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -417,6 +455,12 @@ export class PipelineServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -871,6 +915,14 @@ export class PipelineServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1058,6 +1110,12 @@ export class PipelineServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1236,6 +1294,12 @@ export class PipelineServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, ], }, { @@ -1432,6 +1496,12 @@ export class PipelineServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, ], }, ]; @@ -4217,55 +4287,6 @@ export class PipelineServiceClient { ).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. * @@ -5330,6 +5351,154 @@ export class PipelineServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts index b52eb14e2b6..0b05860bd0c 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts @@ -215,9 +215,6 @@ export class PredictionServiceClient { 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}' ), @@ -267,6 +264,13 @@ export class PredictionServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -1659,55 +1663,6 @@ export class PredictionServiceClient { ).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. * @@ -2736,6 +2691,154 @@ export class PredictionServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts index 0ee46758123..d324ce22672 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts @@ -221,9 +221,6 @@ export class ScheduleServiceClient { 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}' ), @@ -276,6 +273,13 @@ export class ScheduleServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -353,6 +357,12 @@ export class ScheduleServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -362,6 +372,12 @@ export class ScheduleServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -377,6 +393,14 @@ export class ScheduleServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -389,6 +413,14 @@ export class ScheduleServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -402,6 +434,12 @@ export class ScheduleServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -411,6 +449,12 @@ export class ScheduleServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -865,6 +909,14 @@ export class ScheduleServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1052,6 +1104,12 @@ export class ScheduleServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1230,6 +1288,12 @@ export class ScheduleServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, ], }, { @@ -1426,6 +1490,12 @@ export class ScheduleServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, ], }, ]; @@ -3524,55 +3594,6 @@ export class ScheduleServiceClient { ).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. * @@ -4637,6 +4658,154 @@ export class ScheduleServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts index a86de16c48c..e35ef5833f7 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts @@ -226,9 +226,6 @@ export class SpecialistPoolServiceClient { 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}' ), @@ -281,6 +278,13 @@ export class SpecialistPoolServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -358,6 +362,12 @@ export class SpecialistPoolServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -367,6 +377,12 @@ export class SpecialistPoolServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -382,6 +398,14 @@ export class SpecialistPoolServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -394,6 +418,14 @@ export class SpecialistPoolServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -407,6 +439,12 @@ export class SpecialistPoolServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -416,6 +454,12 @@ export class SpecialistPoolServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -870,6 +914,14 @@ export class SpecialistPoolServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1057,6 +1109,12 @@ export class SpecialistPoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1235,6 +1293,12 @@ export class SpecialistPoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, ], }, { @@ -1431,6 +1495,12 @@ export class SpecialistPoolServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, ], }, ]; @@ -3404,55 +3474,6 @@ export class SpecialistPoolServiceClient { ).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. * @@ -4517,6 +4538,154 @@ export class SpecialistPoolServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts index 85179dbb407..5960a396d87 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts @@ -220,9 +220,6 @@ export class TensorboardServiceClient { 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}' ), @@ -278,6 +275,13 @@ export class TensorboardServiceClient { projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -384,6 +388,12 @@ export class TensorboardServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -393,6 +403,12 @@ export class TensorboardServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -408,6 +424,14 @@ export class TensorboardServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -420,6 +444,14 @@ export class TensorboardServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -433,6 +465,12 @@ export class TensorboardServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -442,6 +480,12 @@ export class TensorboardServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -896,6 +940,14 @@ export class TensorboardServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1083,6 +1135,12 @@ export class TensorboardServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1261,6 +1319,12 @@ export class TensorboardServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, ], }, { @@ -1457,6 +1521,12 @@ export class TensorboardServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, ], }, ]; @@ -5421,12 +5491,12 @@ export class TensorboardServiceClient { * Values above 10000 are 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. + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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. + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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 is returned in a pseudo random @@ -5539,12 +5609,12 @@ export class TensorboardServiceClient { * Values above 10000 are 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. + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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. + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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 is returned in a pseudo random @@ -5602,12 +5672,12 @@ export class TensorboardServiceClient { * Values above 10000 are 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. + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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. + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData|ExportTensorboardTimeSeriesData} + * 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 is returned in a pseudo random @@ -6697,55 +6767,6 @@ export class TensorboardServiceClient { ).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. * @@ -7833,6 +7854,154 @@ export class TensorboardServiceClient { return this.pathTemplates.projectPathTemplate.match(projectName).project; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts index d76572ef70a..0f387533801 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts @@ -224,9 +224,6 @@ export class VizierServiceClient { 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}' ), @@ -279,6 +276,13 @@ export class VizierServiceClient { pipelineJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -361,6 +365,12 @@ export class VizierServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -370,6 +380,12 @@ export class VizierServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, ], }, { @@ -385,6 +401,14 @@ export class VizierServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -397,6 +421,14 @@ export class VizierServiceClient { post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -410,6 +442,12 @@ export class VizierServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -419,6 +457,12 @@ export class VizierServiceClient { { post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, ], }, { @@ -873,6 +917,14 @@ export class VizierServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1060,6 +1112,12 @@ export class VizierServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, ], }, { @@ -1238,6 +1296,12 @@ export class VizierServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, ], }, { @@ -1434,6 +1498,12 @@ export class VizierServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, ], }, ]; @@ -4419,55 +4489,6 @@ export class VizierServiceClient { ).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. * @@ -5532,6 +5553,154 @@ export class VizierServiceClient { .pipeline_job; } + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1.ts index 2240aceedc3..935abc36ee1 100644 --- a/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1.ts @@ -4497,70 +4497,6 @@ describe('v1.DatasetServiceClient', () => { }); }); - 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 = { @@ -5798,6 +5734,178 @@ describe('v1.DatasetServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1beta1.ts index 6b2bbe7dbc8..500a4c4a9a4 100644 --- a/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1beta1.ts @@ -4641,70 +4641,6 @@ describe('v1beta1.DatasetServiceClient', () => { }); }); - 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 = { @@ -5942,6 +5878,178 @@ describe('v1beta1.DatasetServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1beta1.ts index 6c982b519f4..4970695a071 100644 --- a/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1beta1.ts @@ -3279,73 +3279,6 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { }); }); - 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 = { @@ -4675,6 +4608,184 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1.ts index 48cb5ff11e3..b81e66a21ec 100644 --- a/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1.ts @@ -1301,6 +1301,200 @@ describe('v1.EndpointServiceClient', () => { }); }); + describe('mutateDeployedModel', () => { + it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.MutateDeployedModelRequest', + ['endpoint'] + ); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.mutateDeployedModel = + stubLongRunningCall(expectedResponse); + const [operation] = await client.mutateDeployedModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.mutateDeployedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateDeployedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.MutateDeployedModelRequest', + ['endpoint'] + ); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.mutateDeployedModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.mutateDeployedModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1.IMutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1.IMutateDeployedModelOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1.IMutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1.IMutateDeployedModelOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.mutateDeployedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateDeployedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.MutateDeployedModelRequest', + ['endpoint'] + ); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateDeployedModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.mutateDeployedModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.mutateDeployedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateDeployedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.MutateDeployedModelRequest', + ['endpoint'] + ); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateDeployedModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.mutateDeployedModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.mutateDeployedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateDeployedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkMutateDeployedModelProgress 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.checkMutateDeployedModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkMutateDeployedModelProgress 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.checkMutateDeployedModelProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('listEndpoints', () => { it('invokes listEndpoints without error', async () => { const client = new endpointserviceModule.v1.EndpointServiceClient({ @@ -3093,70 +3287,6 @@ describe('v1.EndpointServiceClient', () => { }); }); - 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 = { @@ -4394,6 +4524,178 @@ describe('v1.EndpointServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1beta1.ts index 169d8055d2b..16a4b103047 100644 --- a/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1beta1.ts @@ -1301,6 +1301,200 @@ describe('v1beta1.EndpointServiceClient', () => { }); }); + describe('mutateDeployedModel', () => { + it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest', + ['endpoint'] + ); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.mutateDeployedModel = + stubLongRunningCall(expectedResponse); + const [operation] = await client.mutateDeployedModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.mutateDeployedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateDeployedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest', + ['endpoint'] + ); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.mutateDeployedModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.mutateDeployedModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelResponse, + protos.google.cloud.aiplatform.v1beta1.IMutateDeployedModelOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.mutateDeployedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateDeployedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest', + ['endpoint'] + ); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateDeployedModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.mutateDeployedModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.mutateDeployedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateDeployedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mutateDeployedModel 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.MutateDeployedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.MutateDeployedModelRequest', + ['endpoint'] + ); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateDeployedModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.mutateDeployedModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.mutateDeployedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateDeployedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkMutateDeployedModelProgress 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.checkMutateDeployedModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkMutateDeployedModelProgress 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.checkMutateDeployedModelProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('listEndpoints', () => { it('invokes listEndpoints without error', async () => { const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ @@ -3199,70 +3393,6 @@ describe('v1beta1.EndpointServiceClient', () => { }); }); - 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 = { @@ -4500,6 +4630,178 @@ describe('v1beta1.EndpointServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1.ts index a36817e1005..053335f5e70 100644 --- a/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1.ts @@ -1914,73 +1914,6 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { }); }); - 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 = { @@ -3217,6 +3150,184 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1beta1.ts index 17b15ac38f4..7c5c00cbc34 100644 --- a/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1beta1.ts @@ -1998,73 +1998,6 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { }); }); - 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 = { @@ -3301,6 +3234,184 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1.ts index 7be3da17c6e..c6b4b994014 100644 --- a/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1.ts @@ -6324,72 +6324,6 @@ describe('v1.FeaturestoreServiceClient', () => { }); }); - 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 = { @@ -7701,6 +7635,182 @@ describe('v1.FeaturestoreServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1beta1.ts index 23a5823b6c0..af5b5af2cb3 100644 --- a/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1beta1.ts @@ -6305,71 +6305,6 @@ describe('v1beta1.FeaturestoreServiceClient', () => { }); }); - 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 = { @@ -7663,6 +7598,180 @@ describe('v1beta1.FeaturestoreServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1.ts index dda6d47bd05..20f777b1f5f 100644 --- a/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1.ts @@ -3401,71 +3401,6 @@ describe('v1.IndexEndpointServiceClient', () => { }); }); - 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 = { @@ -4720,6 +4655,180 @@ describe('v1.IndexEndpointServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1beta1.ts index 404fb400cfe..541c96d81bd 100644 --- a/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1beta1.ts @@ -3490,71 +3490,6 @@ describe('v1beta1.IndexEndpointServiceClient', () => { }); }); - 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 = { @@ -4809,6 +4744,180 @@ describe('v1beta1.IndexEndpointServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_index_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_index_service_v1.ts index 4a8b430c650..85cb1ccb91f 100644 --- a/packages/google-cloud-aiplatform/test/gapic_index_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_index_service_v1.ts @@ -3020,70 +3020,6 @@ describe('v1.IndexServiceClient', () => { }); }); - 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 = { @@ -4321,6 +4257,178 @@ describe('v1.IndexServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_index_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_index_service_v1beta1.ts index 209072e6213..11758dd3650 100644 --- a/packages/google-cloud-aiplatform/test/gapic_index_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_index_service_v1beta1.ts @@ -3127,70 +3127,6 @@ describe('v1beta1.IndexServiceClient', () => { }); }); - 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 = { @@ -4428,6 +4364,178 @@ describe('v1beta1.IndexServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_job_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_job_service_v1.ts index 79e1d5d14b5..973c1aaea86 100644 --- a/packages/google-cloud-aiplatform/test/gapic_job_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_job_service_v1.ts @@ -8567,70 +8567,6 @@ describe('v1.JobServiceClient', () => { }); }); - 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 = { @@ -9868,6 +9804,178 @@ describe('v1.JobServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_job_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_job_service_v1beta1.ts index 9712b5c66e6..5600a8612fa 100644 --- a/packages/google-cloud-aiplatform/test/gapic_job_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_job_service_v1beta1.ts @@ -8688,70 +8688,6 @@ describe('v1beta1.JobServiceClient', () => { }); }); - 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 = { @@ -9989,6 +9925,178 @@ describe('v1beta1.JobServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_match_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_match_service_v1beta1.ts index 23ff63fd3de..cb6b6888e2f 100644 --- a/packages/google-cloud-aiplatform/test/gapic_match_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_match_service_v1beta1.ts @@ -1715,70 +1715,6 @@ describe('v1beta1.MatchServiceClient', () => { }); }); - describe('endpoint', () => { - const fakePath = '/rendered/path/endpoint'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - endpoint: 'endpointValue', - }; - const client = new matchserviceModule.v1beta1.MatchServiceClient({ - 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 = { @@ -2967,6 +2903,178 @@ describe('v1beta1.MatchServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + endpoint: 'endpointValue', + }; + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1.ts index 9a3c5d32f9f..44c43d7fa63 100644 --- a/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1.ts @@ -7413,70 +7413,6 @@ describe('v1.MetadataServiceClient', () => { }); }); - 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 = { @@ -8752,6 +8688,178 @@ describe('v1.MetadataServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1beta1.ts index 97d2d25518a..6b3a2408263 100644 --- a/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1beta1.ts @@ -7554,70 +7554,6 @@ describe('v1beta1.MetadataServiceClient', () => { }); }); - 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 = { @@ -8893,6 +8829,178 @@ describe('v1beta1.MetadataServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_migration_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_migration_service_v1.ts index 0a903f9889a..78484292155 100644 --- a/packages/google-cloud-aiplatform/test/gapic_migration_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_migration_service_v1.ts @@ -2308,70 +2308,6 @@ describe('v1.MigrationServiceClient', () => { }); }); - 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 = { @@ -3609,6 +3545,178 @@ describe('v1.MigrationServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_migration_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_migration_service_v1beta1.ts index 41a37a049c8..20afc26b4a1 100644 --- a/packages/google-cloud-aiplatform/test/gapic_migration_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_migration_service_v1beta1.ts @@ -2394,70 +2394,6 @@ describe('v1beta1.MigrationServiceClient', () => { }); }); - 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 = { @@ -3695,6 +3631,178 @@ describe('v1beta1.MigrationServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_model_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_model_service_v1.ts index 6df10fdd68a..9e5175b481f 100644 --- a/packages/google-cloud-aiplatform/test/gapic_model_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_model_service_v1.ts @@ -5074,70 +5074,6 @@ describe('v1.ModelServiceClient', () => { }); }); - 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 = { @@ -6375,6 +6311,178 @@ describe('v1.ModelServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_model_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_model_service_v1beta1.ts index 71c74b22c5f..6d05a1617e5 100644 --- a/packages/google-cloud-aiplatform/test/gapic_model_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_model_service_v1beta1.ts @@ -5409,70 +5409,6 @@ describe('v1beta1.ModelServiceClient', () => { }); }); - 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 = { @@ -6710,6 +6646,178 @@ describe('v1beta1.ModelServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1.ts index a8f1cd8812b..520fea06206 100644 --- a/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1.ts @@ -3622,70 +3622,6 @@ describe('v1.PipelineServiceClient', () => { }); }); - 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 = { @@ -4923,6 +4859,178 @@ describe('v1.PipelineServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1beta1.ts index 5f8f3f7ef05..c730a1aa780 100644 --- a/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1beta1.ts @@ -3713,70 +3713,6 @@ describe('v1beta1.PipelineServiceClient', () => { }); }); - 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 = { @@ -5014,6 +4950,178 @@ describe('v1beta1.PipelineServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1.ts index 104a4ca0c44..af8a1d803cf 100644 --- a/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1.ts @@ -1754,70 +1754,6 @@ describe('v1.PredictionServiceClient', () => { }); }); - 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 = { @@ -3006,6 +2942,178 @@ describe('v1.PredictionServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1beta1.ts index da5d93ae941..b08e7e0a9e5 100644 --- a/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1beta1.ts @@ -1878,71 +1878,6 @@ describe('v1beta1.PredictionServiceClient', () => { }); }); - 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 = { @@ -3147,6 +3082,180 @@ describe('v1beta1.PredictionServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_schedule_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_schedule_service_v1beta1.ts index f31d0b25f75..87ff34d9b33 100644 --- a/packages/google-cloud-aiplatform/test/gapic_schedule_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_schedule_service_v1beta1.ts @@ -2877,70 +2877,6 @@ describe('v1beta1.ScheduleServiceClient', () => { }); }); - describe('endpoint', () => { - const fakePath = '/rendered/path/endpoint'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - endpoint: 'endpointValue', - }; - const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ - 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 = { @@ -4178,6 +4114,178 @@ describe('v1beta1.ScheduleServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + endpoint: 'endpointValue', + }; + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1.ts index 0c61b51e9f9..27904dca575 100644 --- a/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1.ts @@ -2872,71 +2872,6 @@ describe('v1.SpecialistPoolServiceClient', () => { }); }); - 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 = { @@ -4191,6 +4126,180 @@ describe('v1.SpecialistPoolServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1beta1.ts index f38b16dbcdd..0deb1286d21 100644 --- a/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1beta1.ts @@ -2959,71 +2959,6 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { }); }); - 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 = { @@ -4278,6 +4213,180 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1.ts index 7071e9acb93..919a5710c6e 100644 --- a/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1.ts @@ -7123,70 +7123,6 @@ describe('v1.TensorboardServiceClient', () => { }); }); - 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 = { @@ -8462,6 +8398,178 @@ describe('v1.TensorboardServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1beta1.ts index 091fe8f0071..7573db8c578 100644 --- a/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1beta1.ts @@ -7402,71 +7402,6 @@ describe('v1beta1.TensorboardServiceClient', () => { }); }); - 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 = { @@ -8760,6 +8695,180 @@ describe('v1beta1.TensorboardServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1.ts index 0fe87b2a791..c88ccccb384 100644 --- a/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1.ts @@ -4180,70 +4180,6 @@ describe('v1.VizierServiceClient', () => { }); }); - 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 = { @@ -5481,6 +5417,178 @@ describe('v1.VizierServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1beta1.ts index 43c83820e7d..4c006bfabef 100644 --- a/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1beta1.ts @@ -4309,70 +4309,6 @@ describe('v1beta1.VizierServiceClient', () => { }); }); - 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 = { @@ -5610,6 +5546,178 @@ describe('v1beta1.VizierServiceClient', () => { }); }); + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + 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.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = {
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.search_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.mutate_deployed_model.jsinclude:samples/generated/v1beta1/endpoint_service.mutate_deployed_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.delete_feature_values.jsinclude:samples/generated/v1beta1/featurestore_service.delete_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_nas_job.jsinclude:samples/generated/v1beta1/job_service.get_nas_job.jsinclude:samples/generated/v1beta1/job_service.cancel_nas_job.jsinclude:samples/generated/v1beta1/job_service.get_nas_trial_detail.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_nas_job.jsinclude:samples/generated/v1beta1/job_service.delete_nas_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_nas_jobs.jsinclude:samples/generated/v1beta1/job_service.list_nas_trial_details.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/match_service.find_neighbors.jsinclude:samples/generated/v1beta1/match_service.read_index_datapoints.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.remove_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.batch_import_evaluated_annotations.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.copy_model.jsinclude:samples/generated/v1beta1/model_service.copy_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/schedule_service.create_schedule.jsinclude:samples/generated/v1beta1/schedule_service.get_schedule.jsinclude:samples/generated/v1beta1/schedule_service.pause_schedule.jsinclude:samples/generated/v1beta1/schedule_service.resume_schedule.jsinclude:samples/generated/v1beta1/schedule_service.delete_schedule.jsinclude:samples/generated/v1beta1/schedule_service.delete_schedule.jsinclude:samples/generated/v1beta1/schedule_service.list_schedules.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.read_tensorboard_usage.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.get_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_runs.jsinclude:samples/generated/v1beta1/tensorboard_service.get_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.get_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.batch_read_tensorboard_time_series_data.jsinclude:samples/generated/v1beta1/tensorboard_service.read_tensorboard_time_series_data.jsinclude:samples/generated/v1beta1/tensorboard_service.write_tensorboard_experiment_data.jsinclude:samples/generated/v1beta1/tensorboard_service.write_tensorboard_run_data.jsinclude:samples/generated/v1beta1/tensorboard_service.read_tensorboard_blob_data.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.list_tensorboards.jsinclude:samples/generated/v1beta1/tensorboard_service.list_tensorboard_experiments.jsinclude:samples/generated/v1beta1/tensorboard_service.list_tensorboard_runs.jsinclude:samples/generated/v1beta1/tensorboard_service.list_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.jsinclude:samples/generated/v1beta1/vizier_service.create_study.jsinclude:samples/generated/v1beta1/vizier_service.get_study.jsinclude:samples/generated/v1beta1/vizier_service.delete_study.jsinclude:samples/generated/v1beta1/vizier_service.lookup_study.jsinclude:samples/generated/v1beta1/vizier_service.create_trial.jsinclude:samples/generated/v1beta1/vizier_service.get_trial.jsinclude:samples/generated/v1beta1/vizier_service.add_trial_measurement.jsinclude:samples/generated/v1beta1/vizier_service.complete_trial.jsinclude:samples/generated/v1beta1/vizier_service.delete_trial.jsinclude:samples/generated/v1beta1/vizier_service.stop_trial.jsinclude:samples/generated/v1beta1/vizier_service.list_optimal_trials.jsinclude:samples/generated/v1beta1/vizier_service.suggest_trials.jsinclude:samples/generated/v1beta1/vizier_service.suggest_trials.jsinclude:samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.jsinclude:samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.jsinclude:samples/generated/v1beta1/vizier_service.list_studies.jsinclude:samples/generated/v1beta1/vizier_service.list_trials.jsinclude:samples/generated/v1/endpoint_service.mutate_deployed_model.jsinclude:samples/generated/v1/endpoint_service.mutate_deployed_model.jsinclude:samples/generated/v1beta1/endpoint_service.mutate_deployed_model.jsinclude:samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js