From 301d706c3e4564da4ce7a0c6f082890e2e111b27 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 00:04:24 +0000 Subject: [PATCH] fix: better support for fallback mode (#625) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 468790263 Source-Link: https://github.com/googleapis/googleapis/commit/873ab456273d105245df0fb82a6c17a814553b80 Source-Link: https://github.com/googleapis/googleapis-gen/commit/cb6f37aeff2a3472e40a7bbace8c67d75e24bee5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2I2ZjM3YWVmZjJhMzQ3MmU0MGE3YmJhY2U4YzY3ZDc1ZTI0YmVlNSJ9 --- .../generated/v1/auto_ml.create_dataset.js | 3 + samples/generated/v1/auto_ml.create_model.js | 3 + .../generated/v1/auto_ml.delete_dataset.js | 3 + samples/generated/v1/auto_ml.delete_model.js | 3 + samples/generated/v1/auto_ml.deploy_model.js | 3 + samples/generated/v1/auto_ml.export_data.js | 3 + samples/generated/v1/auto_ml.export_model.js | 3 + .../v1/auto_ml.get_annotation_spec.js | 3 + samples/generated/v1/auto_ml.get_dataset.js | 3 + samples/generated/v1/auto_ml.get_model.js | 3 + .../v1/auto_ml.get_model_evaluation.js | 3 + samples/generated/v1/auto_ml.import_data.js | 3 + samples/generated/v1/auto_ml.list_datasets.js | 3 + .../v1/auto_ml.list_model_evaluations.js | 3 + samples/generated/v1/auto_ml.list_models.js | 3 + .../generated/v1/auto_ml.undeploy_model.js | 3 + .../generated/v1/auto_ml.update_dataset.js | 3 + samples/generated/v1/auto_ml.update_model.js | 3 + .../v1/prediction_service.batch_predict.js | 3 + .../v1/prediction_service.predict.js | 3 + ...ippet_metadata.google.cloud.automl.v1.json | 40 ++--- .../v1beta1/auto_ml.create_dataset.js | 3 + .../generated/v1beta1/auto_ml.create_model.js | 3 + .../v1beta1/auto_ml.delete_dataset.js | 3 + .../generated/v1beta1/auto_ml.delete_model.js | 3 + .../generated/v1beta1/auto_ml.deploy_model.js | 3 + .../generated/v1beta1/auto_ml.export_data.js | 3 + .../auto_ml.export_evaluated_examples.js | 3 + .../generated/v1beta1/auto_ml.export_model.js | 3 + .../v1beta1/auto_ml.get_annotation_spec.js | 3 + .../v1beta1/auto_ml.get_column_spec.js | 3 + .../generated/v1beta1/auto_ml.get_dataset.js | 3 + .../generated/v1beta1/auto_ml.get_model.js | 3 + .../v1beta1/auto_ml.get_model_evaluation.js | 3 + .../v1beta1/auto_ml.get_table_spec.js | 3 + .../generated/v1beta1/auto_ml.import_data.js | 3 + .../v1beta1/auto_ml.list_column_specs.js | 3 + .../v1beta1/auto_ml.list_datasets.js | 3 + .../v1beta1/auto_ml.list_model_evaluations.js | 3 + .../generated/v1beta1/auto_ml.list_models.js | 3 + .../v1beta1/auto_ml.list_table_specs.js | 3 + .../v1beta1/auto_ml.undeploy_model.js | 3 + .../v1beta1/auto_ml.update_column_spec.js | 3 + .../v1beta1/auto_ml.update_dataset.js | 3 + .../v1beta1/auto_ml.update_table_spec.js | 3 + .../prediction_service.batch_predict.js | 3 + .../v1beta1/prediction_service.predict.js | 3 + ..._metadata.google.cloud.automl.v1beta1.json | 52 +++--- src/v1/auto_ml_client.ts | 34 ++-- src/v1/prediction_service_client.ts | 5 +- src/v1beta1/auto_ml_client.ts | 42 ++--- src/v1beta1/prediction_service_client.ts | 5 +- test/gapic_auto_ml_v1.ts | 156 ++++++++-------- test/gapic_auto_ml_v1beta1.ts | 156 ++++++++-------- test/gapic_prediction_service_v1.ts | 160 +++++++++-------- test/gapic_prediction_service_v1beta1.ts | 168 +++++++++--------- 56 files changed, 555 insertions(+), 401 deletions(-) diff --git a/samples/generated/v1/auto_ml.create_dataset.js b/samples/generated/v1/auto_ml.create_dataset.js index 751c0ad8..03a914a8 100644 --- a/samples/generated/v1/auto_ml.create_dataset.js +++ b/samples/generated/v1/auto_ml.create_dataset.js @@ -23,6 +23,9 @@ function main(parent, dataset) { // [START automl_v1_generated_AutoMl_CreateDataset_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. */ /** diff --git a/samples/generated/v1/auto_ml.create_model.js b/samples/generated/v1/auto_ml.create_model.js index 7a5fe659..ab7df733 100644 --- a/samples/generated/v1/auto_ml.create_model.js +++ b/samples/generated/v1/auto_ml.create_model.js @@ -23,6 +23,9 @@ function main(parent, model) { // [START automl_v1_generated_AutoMl_CreateModel_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. */ /** diff --git a/samples/generated/v1/auto_ml.delete_dataset.js b/samples/generated/v1/auto_ml.delete_dataset.js index 9abccb8f..b56d3dd4 100644 --- a/samples/generated/v1/auto_ml.delete_dataset.js +++ b/samples/generated/v1/auto_ml.delete_dataset.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1_generated_AutoMl_DeleteDataset_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. */ /** diff --git a/samples/generated/v1/auto_ml.delete_model.js b/samples/generated/v1/auto_ml.delete_model.js index 9d7267f8..8768ba4c 100644 --- a/samples/generated/v1/auto_ml.delete_model.js +++ b/samples/generated/v1/auto_ml.delete_model.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1_generated_AutoMl_DeleteModel_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. */ /** diff --git a/samples/generated/v1/auto_ml.deploy_model.js b/samples/generated/v1/auto_ml.deploy_model.js index 89fd2c1e..9248d661 100644 --- a/samples/generated/v1/auto_ml.deploy_model.js +++ b/samples/generated/v1/auto_ml.deploy_model.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1_generated_AutoMl_DeployModel_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. */ /** diff --git a/samples/generated/v1/auto_ml.export_data.js b/samples/generated/v1/auto_ml.export_data.js index 1c181f0c..ffbabbab 100644 --- a/samples/generated/v1/auto_ml.export_data.js +++ b/samples/generated/v1/auto_ml.export_data.js @@ -23,6 +23,9 @@ function main(name, outputConfig) { // [START automl_v1_generated_AutoMl_ExportData_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. */ /** diff --git a/samples/generated/v1/auto_ml.export_model.js b/samples/generated/v1/auto_ml.export_model.js index 1b94e8dc..1943d492 100644 --- a/samples/generated/v1/auto_ml.export_model.js +++ b/samples/generated/v1/auto_ml.export_model.js @@ -23,6 +23,9 @@ function main(name, outputConfig) { // [START automl_v1_generated_AutoMl_ExportModel_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. */ /** diff --git a/samples/generated/v1/auto_ml.get_annotation_spec.js b/samples/generated/v1/auto_ml.get_annotation_spec.js index fa3e3874..48f5d438 100644 --- a/samples/generated/v1/auto_ml.get_annotation_spec.js +++ b/samples/generated/v1/auto_ml.get_annotation_spec.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1_generated_AutoMl_GetAnnotationSpec_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. */ /** diff --git a/samples/generated/v1/auto_ml.get_dataset.js b/samples/generated/v1/auto_ml.get_dataset.js index bfbc8562..7010f3a9 100644 --- a/samples/generated/v1/auto_ml.get_dataset.js +++ b/samples/generated/v1/auto_ml.get_dataset.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1_generated_AutoMl_GetDataset_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. */ /** diff --git a/samples/generated/v1/auto_ml.get_model.js b/samples/generated/v1/auto_ml.get_model.js index 156c8b6a..6f6c19c3 100644 --- a/samples/generated/v1/auto_ml.get_model.js +++ b/samples/generated/v1/auto_ml.get_model.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1_generated_AutoMl_GetModel_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. */ /** diff --git a/samples/generated/v1/auto_ml.get_model_evaluation.js b/samples/generated/v1/auto_ml.get_model_evaluation.js index e2cadb4c..26a13fb7 100644 --- a/samples/generated/v1/auto_ml.get_model_evaluation.js +++ b/samples/generated/v1/auto_ml.get_model_evaluation.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1_generated_AutoMl_GetModelEvaluation_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. */ /** diff --git a/samples/generated/v1/auto_ml.import_data.js b/samples/generated/v1/auto_ml.import_data.js index d428244e..4092243b 100644 --- a/samples/generated/v1/auto_ml.import_data.js +++ b/samples/generated/v1/auto_ml.import_data.js @@ -23,6 +23,9 @@ function main(name, inputConfig) { // [START automl_v1_generated_AutoMl_ImportData_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. */ /** diff --git a/samples/generated/v1/auto_ml.list_datasets.js b/samples/generated/v1/auto_ml.list_datasets.js index e0cf3c76..2f0afe03 100644 --- a/samples/generated/v1/auto_ml.list_datasets.js +++ b/samples/generated/v1/auto_ml.list_datasets.js @@ -23,6 +23,9 @@ function main(parent) { // [START automl_v1_generated_AutoMl_ListDatasets_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. */ /** diff --git a/samples/generated/v1/auto_ml.list_model_evaluations.js b/samples/generated/v1/auto_ml.list_model_evaluations.js index dcb998f8..ec55f540 100644 --- a/samples/generated/v1/auto_ml.list_model_evaluations.js +++ b/samples/generated/v1/auto_ml.list_model_evaluations.js @@ -23,6 +23,9 @@ function main(parent, filter) { // [START automl_v1_generated_AutoMl_ListModelEvaluations_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. */ /** diff --git a/samples/generated/v1/auto_ml.list_models.js b/samples/generated/v1/auto_ml.list_models.js index 0e4fe7e4..c94a3624 100644 --- a/samples/generated/v1/auto_ml.list_models.js +++ b/samples/generated/v1/auto_ml.list_models.js @@ -23,6 +23,9 @@ function main(parent) { // [START automl_v1_generated_AutoMl_ListModels_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. */ /** diff --git a/samples/generated/v1/auto_ml.undeploy_model.js b/samples/generated/v1/auto_ml.undeploy_model.js index b1c3d569..5857bc11 100644 --- a/samples/generated/v1/auto_ml.undeploy_model.js +++ b/samples/generated/v1/auto_ml.undeploy_model.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1_generated_AutoMl_UndeployModel_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. */ /** diff --git a/samples/generated/v1/auto_ml.update_dataset.js b/samples/generated/v1/auto_ml.update_dataset.js index dbda9027..a76afe0d 100644 --- a/samples/generated/v1/auto_ml.update_dataset.js +++ b/samples/generated/v1/auto_ml.update_dataset.js @@ -23,6 +23,9 @@ function main(dataset, updateMask) { // [START automl_v1_generated_AutoMl_UpdateDataset_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. */ /** diff --git a/samples/generated/v1/auto_ml.update_model.js b/samples/generated/v1/auto_ml.update_model.js index 120fa25e..ba07e4c6 100644 --- a/samples/generated/v1/auto_ml.update_model.js +++ b/samples/generated/v1/auto_ml.update_model.js @@ -23,6 +23,9 @@ function main(model, updateMask) { // [START automl_v1_generated_AutoMl_UpdateModel_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. */ /** diff --git a/samples/generated/v1/prediction_service.batch_predict.js b/samples/generated/v1/prediction_service.batch_predict.js index 8b728949..b4cf91d3 100644 --- a/samples/generated/v1/prediction_service.batch_predict.js +++ b/samples/generated/v1/prediction_service.batch_predict.js @@ -23,6 +23,9 @@ function main(name, inputConfig, outputConfig) { // [START automl_v1_generated_PredictionService_BatchPredict_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. */ /** diff --git a/samples/generated/v1/prediction_service.predict.js b/samples/generated/v1/prediction_service.predict.js index 5808206d..da78dc2b 100644 --- a/samples/generated/v1/prediction_service.predict.js +++ b/samples/generated/v1/prediction_service.predict.js @@ -23,6 +23,9 @@ function main(name, payload) { // [START automl_v1_generated_PredictionService_Predict_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. */ /** diff --git a/samples/generated/v1/snippet_metadata.google.cloud.automl.v1.json b/samples/generated/v1/snippet_metadata.google.cloud.automl.v1.json index 8093d0c6..ee46dc53 100644 --- a/samples/generated/v1/snippet_metadata.google.cloud.automl.v1.json +++ b/samples/generated/v1/snippet_metadata.google.cloud.automl.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -66,7 +66,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -106,7 +106,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 75, "type": "FULL" } ], @@ -158,7 +158,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -202,7 +202,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -242,7 +242,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 61, "type": "FULL" } ], @@ -286,7 +286,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -330,7 +330,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -370,7 +370,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -414,7 +414,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -454,7 +454,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 76, "type": "FULL" } ], @@ -506,7 +506,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -546,7 +546,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -590,7 +590,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -638,7 +638,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -678,7 +678,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -722,7 +722,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -762,7 +762,7 @@ "segments": [ { "start": 25, - "end": 77, + "end": 80, "type": "FULL" } ], @@ -814,7 +814,7 @@ "segments": [ { "start": 25, - "end": 82, + "end": 85, "type": "FULL" } ], @@ -862,7 +862,7 @@ "segments": [ { "start": 25, - "end": 130, + "end": 133, "type": "FULL" } ], diff --git a/samples/generated/v1beta1/auto_ml.create_dataset.js b/samples/generated/v1beta1/auto_ml.create_dataset.js index 8b83e509..db1c5335 100644 --- a/samples/generated/v1beta1/auto_ml.create_dataset.js +++ b/samples/generated/v1beta1/auto_ml.create_dataset.js @@ -23,6 +23,9 @@ function main(parent, dataset) { // [START automl_v1beta1_generated_AutoMl_CreateDataset_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.create_model.js b/samples/generated/v1beta1/auto_ml.create_model.js index 122bd588..5285f037 100644 --- a/samples/generated/v1beta1/auto_ml.create_model.js +++ b/samples/generated/v1beta1/auto_ml.create_model.js @@ -23,6 +23,9 @@ function main(parent, model) { // [START automl_v1beta1_generated_AutoMl_CreateModel_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.delete_dataset.js b/samples/generated/v1beta1/auto_ml.delete_dataset.js index 2f6d9839..9add7871 100644 --- a/samples/generated/v1beta1/auto_ml.delete_dataset.js +++ b/samples/generated/v1beta1/auto_ml.delete_dataset.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1beta1_generated_AutoMl_DeleteDataset_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.delete_model.js b/samples/generated/v1beta1/auto_ml.delete_model.js index f10e81cd..9b3af2aa 100644 --- a/samples/generated/v1beta1/auto_ml.delete_model.js +++ b/samples/generated/v1beta1/auto_ml.delete_model.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1beta1_generated_AutoMl_DeleteModel_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.deploy_model.js b/samples/generated/v1beta1/auto_ml.deploy_model.js index 507eece3..824b34b5 100644 --- a/samples/generated/v1beta1/auto_ml.deploy_model.js +++ b/samples/generated/v1beta1/auto_ml.deploy_model.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1beta1_generated_AutoMl_DeployModel_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.export_data.js b/samples/generated/v1beta1/auto_ml.export_data.js index dd70a887..4f61d955 100644 --- a/samples/generated/v1beta1/auto_ml.export_data.js +++ b/samples/generated/v1beta1/auto_ml.export_data.js @@ -23,6 +23,9 @@ function main(name, outputConfig) { // [START automl_v1beta1_generated_AutoMl_ExportData_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js b/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js index 5251b7a7..e8b8b2b9 100644 --- a/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js +++ b/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js @@ -23,6 +23,9 @@ function main(name, outputConfig) { // [START automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.export_model.js b/samples/generated/v1beta1/auto_ml.export_model.js index 56e97405..d4e0ef39 100644 --- a/samples/generated/v1beta1/auto_ml.export_model.js +++ b/samples/generated/v1beta1/auto_ml.export_model.js @@ -23,6 +23,9 @@ function main(name, outputConfig) { // [START automl_v1beta1_generated_AutoMl_ExportModel_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.get_annotation_spec.js b/samples/generated/v1beta1/auto_ml.get_annotation_spec.js index 54cc0b38..a45ce2b2 100644 --- a/samples/generated/v1beta1/auto_ml.get_annotation_spec.js +++ b/samples/generated/v1beta1/auto_ml.get_annotation_spec.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1beta1_generated_AutoMl_GetAnnotationSpec_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.get_column_spec.js b/samples/generated/v1beta1/auto_ml.get_column_spec.js index 00989ce8..cf99ba4d 100644 --- a/samples/generated/v1beta1/auto_ml.get_column_spec.js +++ b/samples/generated/v1beta1/auto_ml.get_column_spec.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1beta1_generated_AutoMl_GetColumnSpec_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.get_dataset.js b/samples/generated/v1beta1/auto_ml.get_dataset.js index 3d5b3b85..1a87f448 100644 --- a/samples/generated/v1beta1/auto_ml.get_dataset.js +++ b/samples/generated/v1beta1/auto_ml.get_dataset.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1beta1_generated_AutoMl_GetDataset_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.get_model.js b/samples/generated/v1beta1/auto_ml.get_model.js index 15217079..c271b908 100644 --- a/samples/generated/v1beta1/auto_ml.get_model.js +++ b/samples/generated/v1beta1/auto_ml.get_model.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1beta1_generated_AutoMl_GetModel_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.get_model_evaluation.js b/samples/generated/v1beta1/auto_ml.get_model_evaluation.js index b53b8569..2d398a0a 100644 --- a/samples/generated/v1beta1/auto_ml.get_model_evaluation.js +++ b/samples/generated/v1beta1/auto_ml.get_model_evaluation.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1beta1_generated_AutoMl_GetModelEvaluation_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.get_table_spec.js b/samples/generated/v1beta1/auto_ml.get_table_spec.js index ea915743..e8a0f457 100644 --- a/samples/generated/v1beta1/auto_ml.get_table_spec.js +++ b/samples/generated/v1beta1/auto_ml.get_table_spec.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1beta1_generated_AutoMl_GetTableSpec_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.import_data.js b/samples/generated/v1beta1/auto_ml.import_data.js index eae51b07..5842f4bd 100644 --- a/samples/generated/v1beta1/auto_ml.import_data.js +++ b/samples/generated/v1beta1/auto_ml.import_data.js @@ -23,6 +23,9 @@ function main(name, inputConfig) { // [START automl_v1beta1_generated_AutoMl_ImportData_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.list_column_specs.js b/samples/generated/v1beta1/auto_ml.list_column_specs.js index 36d48225..a394e219 100644 --- a/samples/generated/v1beta1/auto_ml.list_column_specs.js +++ b/samples/generated/v1beta1/auto_ml.list_column_specs.js @@ -23,6 +23,9 @@ function main(parent) { // [START automl_v1beta1_generated_AutoMl_ListColumnSpecs_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.list_datasets.js b/samples/generated/v1beta1/auto_ml.list_datasets.js index e7dcc8a2..dab6a91e 100644 --- a/samples/generated/v1beta1/auto_ml.list_datasets.js +++ b/samples/generated/v1beta1/auto_ml.list_datasets.js @@ -23,6 +23,9 @@ function main(parent) { // [START automl_v1beta1_generated_AutoMl_ListDatasets_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.list_model_evaluations.js b/samples/generated/v1beta1/auto_ml.list_model_evaluations.js index 18fec86f..3fa0ee1d 100644 --- a/samples/generated/v1beta1/auto_ml.list_model_evaluations.js +++ b/samples/generated/v1beta1/auto_ml.list_model_evaluations.js @@ -23,6 +23,9 @@ function main(parent) { // [START automl_v1beta1_generated_AutoMl_ListModelEvaluations_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.list_models.js b/samples/generated/v1beta1/auto_ml.list_models.js index c4a43946..c2a2fab0 100644 --- a/samples/generated/v1beta1/auto_ml.list_models.js +++ b/samples/generated/v1beta1/auto_ml.list_models.js @@ -23,6 +23,9 @@ function main(parent) { // [START automl_v1beta1_generated_AutoMl_ListModels_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.list_table_specs.js b/samples/generated/v1beta1/auto_ml.list_table_specs.js index 281c695d..fc7dbce7 100644 --- a/samples/generated/v1beta1/auto_ml.list_table_specs.js +++ b/samples/generated/v1beta1/auto_ml.list_table_specs.js @@ -23,6 +23,9 @@ function main(parent) { // [START automl_v1beta1_generated_AutoMl_ListTableSpecs_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.undeploy_model.js b/samples/generated/v1beta1/auto_ml.undeploy_model.js index 1bdd4ebd..4bbf33ce 100644 --- a/samples/generated/v1beta1/auto_ml.undeploy_model.js +++ b/samples/generated/v1beta1/auto_ml.undeploy_model.js @@ -23,6 +23,9 @@ function main(name) { // [START automl_v1beta1_generated_AutoMl_UndeployModel_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.update_column_spec.js b/samples/generated/v1beta1/auto_ml.update_column_spec.js index fce710f7..800b134b 100644 --- a/samples/generated/v1beta1/auto_ml.update_column_spec.js +++ b/samples/generated/v1beta1/auto_ml.update_column_spec.js @@ -23,6 +23,9 @@ function main(columnSpec) { // [START automl_v1beta1_generated_AutoMl_UpdateColumnSpec_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.update_dataset.js b/samples/generated/v1beta1/auto_ml.update_dataset.js index 0c611b5b..e7886a11 100644 --- a/samples/generated/v1beta1/auto_ml.update_dataset.js +++ b/samples/generated/v1beta1/auto_ml.update_dataset.js @@ -23,6 +23,9 @@ function main(dataset) { // [START automl_v1beta1_generated_AutoMl_UpdateDataset_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. */ /** diff --git a/samples/generated/v1beta1/auto_ml.update_table_spec.js b/samples/generated/v1beta1/auto_ml.update_table_spec.js index d64a7afc..18a9f2de 100644 --- a/samples/generated/v1beta1/auto_ml.update_table_spec.js +++ b/samples/generated/v1beta1/auto_ml.update_table_spec.js @@ -23,6 +23,9 @@ function main(tableSpec) { // [START automl_v1beta1_generated_AutoMl_UpdateTableSpec_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. */ /** diff --git a/samples/generated/v1beta1/prediction_service.batch_predict.js b/samples/generated/v1beta1/prediction_service.batch_predict.js index 6abb00c8..7a16a4d6 100644 --- a/samples/generated/v1beta1/prediction_service.batch_predict.js +++ b/samples/generated/v1beta1/prediction_service.batch_predict.js @@ -23,6 +23,9 @@ function main(name, inputConfig, outputConfig, params) { // [START automl_v1beta1_generated_PredictionService_BatchPredict_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. */ /** diff --git a/samples/generated/v1beta1/prediction_service.predict.js b/samples/generated/v1beta1/prediction_service.predict.js index 442aeb78..c5852bc0 100644 --- a/samples/generated/v1beta1/prediction_service.predict.js +++ b/samples/generated/v1beta1/prediction_service.predict.js @@ -23,6 +23,9 @@ function main(name, payload) { // [START automl_v1beta1_generated_PredictionService_Predict_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. */ /** diff --git a/samples/generated/v1beta1/snippet_metadata.google.cloud.automl.v1beta1.json b/samples/generated/v1beta1/snippet_metadata.google.cloud.automl.v1beta1.json index a6adf4d3..e7c95f38 100644 --- a/samples/generated/v1beta1/snippet_metadata.google.cloud.automl.v1beta1.json +++ b/samples/generated/v1beta1/snippet_metadata.google.cloud.automl.v1beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -66,7 +66,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -106,7 +106,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 76, "type": "FULL" } ], @@ -158,7 +158,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 57, "type": "FULL" } ], @@ -202,7 +202,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -242,7 +242,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 61, "type": "FULL" } ], @@ -286,7 +286,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -330,7 +330,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -370,7 +370,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 57, "type": "FULL" } ], @@ -414,7 +414,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 75, "type": "FULL" } ], @@ -470,7 +470,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 57, "type": "FULL" } ], @@ -514,7 +514,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 57, "type": "FULL" } ], @@ -558,7 +558,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 75, "type": "FULL" } ], @@ -614,7 +614,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 57, "type": "FULL" } ], @@ -658,7 +658,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -702,7 +702,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -742,7 +742,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 76, "type": "FULL" } ], @@ -794,7 +794,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -834,7 +834,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -882,7 +882,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -922,7 +922,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -966,7 +966,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], @@ -1010,7 +1010,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -1050,7 +1050,7 @@ "segments": [ { "start": 25, - "end": 76, + "end": 79, "type": "FULL" } ], @@ -1102,7 +1102,7 @@ "segments": [ { "start": 25, - "end": 76, + "end": 79, "type": "FULL" } ], @@ -1150,7 +1150,7 @@ "segments": [ { "start": 25, - "end": 124, + "end": 127, "type": "FULL" } ], diff --git a/src/v1/auto_ml_client.ts b/src/v1/auto_ml_client.ts index 11b40427..6907dd26 100644 --- a/src/v1/auto_ml_client.ts +++ b/src/v1/auto_ml_client.ts @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -489,7 +488,8 @@ export class AutoMlClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1204,7 +1204,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createDataset, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.automl.v1.Dataset, @@ -1345,7 +1345,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteDataset, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1494,7 +1494,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.importData, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1635,7 +1635,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.exportData, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1778,7 +1778,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createModel, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.automl.v1.Model, @@ -1919,7 +1919,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteModel, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -2070,7 +2070,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deployModel, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -2213,7 +2213,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.undeployModel, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -2358,7 +2358,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.exportModel, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -2520,7 +2520,7 @@ export class AutoMlClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listDatasets.createStream( - this.innerApiCalls.listDatasets as gax.GaxCall, + this.innerApiCalls.listDatasets as GaxCall, request, callSettings ); @@ -2580,7 +2580,7 @@ export class AutoMlClient { this.initialize(); return this.descriptors.page.listDatasets.asyncIterate( this.innerApiCalls['listDatasets'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2739,7 +2739,7 @@ export class AutoMlClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listModels.createStream( - this.innerApiCalls.listModels as gax.GaxCall, + this.innerApiCalls.listModels as GaxCall, request, callSettings ); @@ -2800,7 +2800,7 @@ export class AutoMlClient { this.initialize(); return this.descriptors.page.listModels.asyncIterate( this.innerApiCalls['listModels'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2975,7 +2975,7 @@ export class AutoMlClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listModelEvaluations.createStream( - this.innerApiCalls.listModelEvaluations as gax.GaxCall, + this.innerApiCalls.listModelEvaluations as GaxCall, request, callSettings ); @@ -3040,7 +3040,7 @@ export class AutoMlClient { this.initialize(); return this.descriptors.page.listModelEvaluations.asyncIterate( this.innerApiCalls['listModelEvaluations'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/src/v1/prediction_service_client.ts b/src/v1/prediction_service_client.ts index 9ad90757..f892c0c6 100644 --- a/src/v1/prediction_service_client.ts +++ b/src/v1/prediction_service_client.ts @@ -341,7 +341,8 @@ export class PredictionServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -790,7 +791,7 @@ export class PredictionServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.batchPredict, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.automl.v1.BatchPredictResult, diff --git a/src/v1beta1/auto_ml_client.ts b/src/v1beta1/auto_ml_client.ts index 361bb7c9..4d60e86f 100644 --- a/src/v1beta1/auto_ml_client.ts +++ b/src/v1beta1/auto_ml_client.ts @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -507,7 +506,8 @@ export class AutoMlClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1614,7 +1614,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteDataset, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1763,7 +1763,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.importData, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1904,7 +1904,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.exportData, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -2047,7 +2047,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createModel, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.automl.v1beta1.Model, @@ -2188,7 +2188,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteModel, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -2340,7 +2340,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deployModel, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -2483,7 +2483,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.undeployModel, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -2629,7 +2629,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.exportModel, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -2786,7 +2786,7 @@ export class AutoMlClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.exportEvaluatedExamples, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -2956,7 +2956,7 @@ export class AutoMlClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listDatasets.createStream( - this.innerApiCalls.listDatasets as gax.GaxCall, + this.innerApiCalls.listDatasets as GaxCall, request, callSettings ); @@ -3017,7 +3017,7 @@ export class AutoMlClient { this.initialize(); return this.descriptors.page.listDatasets.asyncIterate( this.innerApiCalls['listDatasets'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3174,7 +3174,7 @@ export class AutoMlClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listTableSpecs.createStream( - this.innerApiCalls.listTableSpecs as gax.GaxCall, + this.innerApiCalls.listTableSpecs as GaxCall, request, callSettings ); @@ -3230,7 +3230,7 @@ export class AutoMlClient { this.initialize(); return this.descriptors.page.listTableSpecs.asyncIterate( this.innerApiCalls['listTableSpecs'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3387,7 +3387,7 @@ export class AutoMlClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listColumnSpecs.createStream( - this.innerApiCalls.listColumnSpecs as gax.GaxCall, + this.innerApiCalls.listColumnSpecs as GaxCall, request, callSettings ); @@ -3443,7 +3443,7 @@ export class AutoMlClient { this.initialize(); return this.descriptors.page.listColumnSpecs.asyncIterate( this.innerApiCalls['listColumnSpecs'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3604,7 +3604,7 @@ export class AutoMlClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listModels.createStream( - this.innerApiCalls.listModels as gax.GaxCall, + this.innerApiCalls.listModels as GaxCall, request, callSettings ); @@ -3665,7 +3665,7 @@ export class AutoMlClient { this.initialize(); return this.descriptors.page.listModels.asyncIterate( this.innerApiCalls['listModels'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3840,7 +3840,7 @@ export class AutoMlClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listModelEvaluations.createStream( - this.innerApiCalls.listModelEvaluations as gax.GaxCall, + this.innerApiCalls.listModelEvaluations as GaxCall, request, callSettings ); @@ -3905,7 +3905,7 @@ export class AutoMlClient { this.initialize(); return this.descriptors.page.listModelEvaluations.asyncIterate( this.innerApiCalls['listModelEvaluations'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/src/v1beta1/prediction_service_client.ts b/src/v1beta1/prediction_service_client.ts index 36d8e19d..4c8000bc 100644 --- a/src/v1beta1/prediction_service_client.ts +++ b/src/v1beta1/prediction_service_client.ts @@ -339,7 +339,8 @@ export class PredictionServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -744,7 +745,7 @@ export class PredictionServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.batchPredict, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.automl.v1beta1.BatchPredictResult, diff --git a/test/gapic_auto_ml_v1.ts b/test/gapic_auto_ml_v1.ts index 1f179248..5547aee8 100644 --- a/test/gapic_auto_ml_v1.ts +++ b/test/gapic_auto_ml_v1.ts @@ -145,99 +145,101 @@ function stubAsyncIterationCall( } describe('v1.AutoMlClient', () => { - it('has servicePath', () => { - const servicePath = automlModule.v1.AutoMlClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = automlModule.v1.AutoMlClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = automlModule.v1.AutoMlClient.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = automlModule.v1.AutoMlClient.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new automlModule.v1.AutoMlClient(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = automlModule.v1.AutoMlClient.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new automlModule.v1.AutoMlClient({ - fallback: true, + it('has port', () => { + const port = automlModule.v1.AutoMlClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new automlModule.v1.AutoMlClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new automlModule.v1.AutoMlClient(); + assert(client); }); - assert.strictEqual(client.autoMlStub, undefined); - await client.initialize(); - assert(client.autoMlStub); - }); - it('has close method for the initialized client', done => { - const client = new automlModule.v1.AutoMlClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new automlModule.v1.AutoMlClient({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.autoMlStub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoMlStub, undefined); + await client.initialize(); + assert(client.autoMlStub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new automlModule.v1.AutoMlClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.autoMlStub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.autoMlStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoMlStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new automlModule.v1.AutoMlClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new automlModule.v1.AutoMlClient({ + 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()); }); - 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 automlModule.v1.AutoMlClient({ - 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); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new automlModule.v1.AutoMlClient({ + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getDataset', () => { diff --git a/test/gapic_auto_ml_v1beta1.ts b/test/gapic_auto_ml_v1beta1.ts index 75d4918b..22107452 100644 --- a/test/gapic_auto_ml_v1beta1.ts +++ b/test/gapic_auto_ml_v1beta1.ts @@ -145,99 +145,101 @@ function stubAsyncIterationCall( } describe('v1beta1.AutoMlClient', () => { - it('has servicePath', () => { - const servicePath = automlModule.v1beta1.AutoMlClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = automlModule.v1beta1.AutoMlClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = automlModule.v1beta1.AutoMlClient.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = automlModule.v1beta1.AutoMlClient.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new automlModule.v1beta1.AutoMlClient(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = automlModule.v1beta1.AutoMlClient.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new automlModule.v1beta1.AutoMlClient({ - fallback: true, + it('has port', () => { + const port = automlModule.v1beta1.AutoMlClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new automlModule.v1beta1.AutoMlClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new automlModule.v1beta1.AutoMlClient(); + assert(client); }); - assert.strictEqual(client.autoMlStub, undefined); - await client.initialize(); - assert(client.autoMlStub); - }); - it('has close method for the initialized client', done => { - const client = new automlModule.v1beta1.AutoMlClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new automlModule.v1beta1.AutoMlClient({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.autoMlStub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoMlStub, undefined); + await client.initialize(); + assert(client.autoMlStub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new automlModule.v1beta1.AutoMlClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.autoMlStub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.autoMlStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoMlStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new automlModule.v1beta1.AutoMlClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new automlModule.v1beta1.AutoMlClient({ + 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()); }); - 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 automlModule.v1beta1.AutoMlClient({ - 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); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new automlModule.v1beta1.AutoMlClient({ + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('createDataset', () => { diff --git a/test/gapic_prediction_service_v1.ts b/test/gapic_prediction_service_v1.ts index 22ecc759..14b641e5 100644 --- a/test/gapic_prediction_service_v1.ts +++ b/test/gapic_prediction_service_v1.ts @@ -82,101 +82,103 @@ function stubLongRunningCallWithCallback( } describe('v1.PredictionServiceClient', () => { - it('has servicePath', () => { - const servicePath = - predictionserviceModule.v1.PredictionServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - predictionserviceModule.v1.PredictionServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = predictionserviceModule.v1.PredictionServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new predictionserviceModule.v1.PredictionServiceClient(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + predictionserviceModule.v1.PredictionServiceClient.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = + predictionserviceModule.v1.PredictionServiceClient.apiEndpoint; + assert(apiEndpoint); }); - 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', + it('has port', () => { + const port = predictionserviceModule.v1.PredictionServiceClient.port; + assert(port); + assert(typeof port === 'number'); }); - 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', + it('should create a client with no option', () => { + const client = new predictionserviceModule.v1.PredictionServiceClient(); + assert(client); }); - client.initialize(); - assert(client.predictionServiceStub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + fallback: true, + }); + assert(client); }); - }); - 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', + 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); }); - assert.strictEqual(client.predictionServiceStub, undefined); - client.close().then(() => { - done(); + + 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 getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + 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(); + }); }); - 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', + 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()); }); - 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); - } + + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('predict', () => { diff --git a/test/gapic_prediction_service_v1beta1.ts b/test/gapic_prediction_service_v1beta1.ts index dc0daf48..81e56c39 100644 --- a/test/gapic_prediction_service_v1beta1.ts +++ b/test/gapic_prediction_service_v1beta1.ts @@ -82,102 +82,110 @@ function stubLongRunningCallWithCallback( } describe('v1beta1.PredictionServiceClient', () => { - it('has servicePath', () => { - const servicePath = - predictionserviceModule.v1beta1.PredictionServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - predictionserviceModule.v1beta1.PredictionServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = predictionserviceModule.v1beta1.PredictionServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = - new predictionserviceModule.v1beta1.PredictionServiceClient(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + predictionserviceModule.v1beta1.PredictionServiceClient.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = + predictionserviceModule.v1beta1.PredictionServiceClient.apiEndpoint; + assert(apiEndpoint); }); - 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', + it('has port', () => { + const port = predictionserviceModule.v1beta1.PredictionServiceClient.port; + assert(port); + assert(typeof port === 'number'); }); - 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', + it('should create a client with no option', () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient(); + assert(client); }); - client.initialize(); - assert(client.predictionServiceStub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + fallback: true, + }); + assert(client); }); - }); - 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', + 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); }); - assert.strictEqual(client.predictionServiceStub, undefined); - client.close().then(() => { - done(); + + 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 getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + 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(); + }); }); - 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', + 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()); }); - 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); - } + + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('predict', () => {