From ae5f1aef32f87c7a8ca6a1d4189bf12369d0259e 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:42 +0000 Subject: [PATCH] fix: better support for fallback mode (#348) - [ ] 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 --- ...ocessor_service.batch_process_documents.js | 3 + ...ment_processor_service.create_processor.js | 3 + ...ment_processor_service.delete_processor.js | 3 + ...cessor_service.delete_processor_version.js | 3 + ...cessor_service.deploy_processor_version.js | 3 + ...ent_processor_service.disable_processor.js | 3 + ...ment_processor_service.enable_processor.js | 3 + ...processor_service.fetch_processor_types.js | 3 + ...ocument_processor_service.get_processor.js | 3 + ...processor_service.get_processor_version.js | 3 + ..._processor_service.list_processor_types.js | 3 + ...ocessor_service.list_processor_versions.js | 3 + ...ument_processor_service.list_processors.js | 3 + ...ment_processor_service.process_document.js | 3 + ...ument_processor_service.review_document.js | 3 + ...r_service.set_default_processor_version.js | 3 + ...ssor_service.undeploy_processor_version.js | 3 + ...t_metadata.google.cloud.documentai.v1.json | 34 +-- ...tanding_service.batch_process_documents.js | 3 + ...adata.google.cloud.documentai.v1beta1.json | 2 +- ...tanding_service.batch_process_documents.js | 3 + ..._understanding_service.process_document.js | 3 + ...adata.google.cloud.documentai.v1beta2.json | 4 +- ...ocessor_service.batch_process_documents.js | 3 + ...ment_processor_service.create_processor.js | 3 + ...ment_processor_service.delete_processor.js | 3 + ...cessor_service.delete_processor_version.js | 3 + ...cessor_service.deploy_processor_version.js | 3 + ...ent_processor_service.disable_processor.js | 3 + ...ment_processor_service.enable_processor.js | 3 + ...processor_service.fetch_processor_types.js | 3 + ...ocument_processor_service.get_processor.js | 3 + ...processor_service.get_processor_version.js | 3 + ..._processor_service.list_processor_types.js | 3 + ...ocessor_service.list_processor_versions.js | 3 + ...ument_processor_service.list_processors.js | 3 + ...ment_processor_service.process_document.js | 3 + ...ument_processor_service.review_document.js | 3 + ...r_service.set_default_processor_version.js | 3 + ...ssor_service.undeploy_processor_version.js | 3 + ...adata.google.cloud.documentai.v1beta3.json | 34 +-- src/v1/document_processor_service_client.ts | 34 +-- .../document_understanding_service_client.ts | 5 +- .../document_understanding_service_client.ts | 5 +- .../document_processor_service_client.ts | 34 +-- test/gapic_document_processor_service_v1.ts | 182 +++++++-------- ...apic_document_processor_service_v1beta3.ts | 212 +++++++++--------- ..._document_understanding_service_v1beta1.ts | 212 +++++++++--------- ..._document_understanding_service_v1beta2.ts | 212 +++++++++--------- 49 files changed, 601 insertions(+), 480 deletions(-) diff --git a/samples/generated/v1/document_processor_service.batch_process_documents.js b/samples/generated/v1/document_processor_service.batch_process_documents.js index b7ae22929..c099efd7b 100644 --- a/samples/generated/v1/document_processor_service.batch_process_documents.js +++ b/samples/generated/v1/document_processor_service.batch_process_documents.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_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/document_processor_service.create_processor.js b/samples/generated/v1/document_processor_service.create_processor.js index dabf1797e..24da55f86 100644 --- a/samples/generated/v1/document_processor_service.create_processor.js +++ b/samples/generated/v1/document_processor_service.create_processor.js @@ -23,6 +23,9 @@ function main(parent, processor) { // [START documentai_v1_generated_DocumentProcessorService_CreateProcessor_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/document_processor_service.delete_processor.js b/samples/generated/v1/document_processor_service.delete_processor.js index 9b6be82cf..2c087b70d 100644 --- a/samples/generated/v1/document_processor_service.delete_processor.js +++ b/samples/generated/v1/document_processor_service.delete_processor.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1_generated_DocumentProcessorService_DeleteProcessor_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/document_processor_service.delete_processor_version.js b/samples/generated/v1/document_processor_service.delete_processor_version.js index 2afd2cb69..2f19c69d8 100644 --- a/samples/generated/v1/document_processor_service.delete_processor_version.js +++ b/samples/generated/v1/document_processor_service.delete_processor_version.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1_generated_DocumentProcessorService_DeleteProcessorVersion_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/document_processor_service.deploy_processor_version.js b/samples/generated/v1/document_processor_service.deploy_processor_version.js index e2eb5a3f5..093797360 100644 --- a/samples/generated/v1/document_processor_service.deploy_processor_version.js +++ b/samples/generated/v1/document_processor_service.deploy_processor_version.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1_generated_DocumentProcessorService_DeployProcessorVersion_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/document_processor_service.disable_processor.js b/samples/generated/v1/document_processor_service.disable_processor.js index 31cb7edf0..80a52d09a 100644 --- a/samples/generated/v1/document_processor_service.disable_processor.js +++ b/samples/generated/v1/document_processor_service.disable_processor.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1_generated_DocumentProcessorService_DisableProcessor_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/document_processor_service.enable_processor.js b/samples/generated/v1/document_processor_service.enable_processor.js index a0cb036be..8d66f45c0 100644 --- a/samples/generated/v1/document_processor_service.enable_processor.js +++ b/samples/generated/v1/document_processor_service.enable_processor.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1_generated_DocumentProcessorService_EnableProcessor_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/document_processor_service.fetch_processor_types.js b/samples/generated/v1/document_processor_service.fetch_processor_types.js index d995bb995..5bb5c2383 100644 --- a/samples/generated/v1/document_processor_service.fetch_processor_types.js +++ b/samples/generated/v1/document_processor_service.fetch_processor_types.js @@ -23,6 +23,9 @@ function main(parent) { // [START documentai_v1_generated_DocumentProcessorService_FetchProcessorTypes_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/document_processor_service.get_processor.js b/samples/generated/v1/document_processor_service.get_processor.js index 9a15ee519..91913575c 100644 --- a/samples/generated/v1/document_processor_service.get_processor.js +++ b/samples/generated/v1/document_processor_service.get_processor.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1_generated_DocumentProcessorService_GetProcessor_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/document_processor_service.get_processor_version.js b/samples/generated/v1/document_processor_service.get_processor_version.js index c15c9e0a9..31bcc81a0 100644 --- a/samples/generated/v1/document_processor_service.get_processor_version.js +++ b/samples/generated/v1/document_processor_service.get_processor_version.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1_generated_DocumentProcessorService_GetProcessorVersion_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/document_processor_service.list_processor_types.js b/samples/generated/v1/document_processor_service.list_processor_types.js index 647022980..a900fd1e2 100644 --- a/samples/generated/v1/document_processor_service.list_processor_types.js +++ b/samples/generated/v1/document_processor_service.list_processor_types.js @@ -23,6 +23,9 @@ function main(parent) { // [START documentai_v1_generated_DocumentProcessorService_ListProcessorTypes_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/document_processor_service.list_processor_versions.js b/samples/generated/v1/document_processor_service.list_processor_versions.js index 0a1c16204..490c0fb50 100644 --- a/samples/generated/v1/document_processor_service.list_processor_versions.js +++ b/samples/generated/v1/document_processor_service.list_processor_versions.js @@ -23,6 +23,9 @@ function main(parent) { // [START documentai_v1_generated_DocumentProcessorService_ListProcessorVersions_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/document_processor_service.list_processors.js b/samples/generated/v1/document_processor_service.list_processors.js index 3038b0929..62b63c5ce 100644 --- a/samples/generated/v1/document_processor_service.list_processors.js +++ b/samples/generated/v1/document_processor_service.list_processors.js @@ -23,6 +23,9 @@ function main(parent) { // [START documentai_v1_generated_DocumentProcessorService_ListProcessors_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/document_processor_service.process_document.js b/samples/generated/v1/document_processor_service.process_document.js index e22847c42..f32cd03e0 100644 --- a/samples/generated/v1/document_processor_service.process_document.js +++ b/samples/generated/v1/document_processor_service.process_document.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1_generated_DocumentProcessorService_ProcessDocument_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/document_processor_service.review_document.js b/samples/generated/v1/document_processor_service.review_document.js index 8dbd18cb4..583b5a9b1 100644 --- a/samples/generated/v1/document_processor_service.review_document.js +++ b/samples/generated/v1/document_processor_service.review_document.js @@ -23,6 +23,9 @@ function main(humanReviewConfig) { // [START documentai_v1_generated_DocumentProcessorService_ReviewDocument_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/document_processor_service.set_default_processor_version.js b/samples/generated/v1/document_processor_service.set_default_processor_version.js index 8005da637..64556b986 100644 --- a/samples/generated/v1/document_processor_service.set_default_processor_version.js +++ b/samples/generated/v1/document_processor_service.set_default_processor_version.js @@ -23,6 +23,9 @@ function main(processor, defaultProcessorVersion) { // [START documentai_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_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/document_processor_service.undeploy_processor_version.js b/samples/generated/v1/document_processor_service.undeploy_processor_version.js index 7a617c1ef..5c84587ee 100644 --- a/samples/generated/v1/document_processor_service.undeploy_processor_version.js +++ b/samples/generated/v1/document_processor_service.undeploy_processor_version.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1_generated_DocumentProcessorService_UndeployProcessorVersion_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.documentai.v1.json b/samples/generated/v1/snippet_metadata.google.cloud.documentai.v1.json index 3075521f8..245fbffc2 100644 --- a/samples/generated/v1/snippet_metadata.google.cloud.documentai.v1.json +++ b/samples/generated/v1/snippet_metadata.google.cloud.documentai.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 75, "type": "FULL" } ], @@ -78,7 +78,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], @@ -130,7 +130,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -170,7 +170,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -218,7 +218,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -266,7 +266,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -306,7 +306,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -346,7 +346,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -394,7 +394,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -434,7 +434,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -474,7 +474,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -514,7 +514,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], @@ -558,7 +558,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -598,7 +598,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -638,7 +638,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -678,7 +678,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 61, "type": "FULL" } ], @@ -722,7 +722,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], diff --git a/samples/generated/v1beta1/document_understanding_service.batch_process_documents.js b/samples/generated/v1beta1/document_understanding_service.batch_process_documents.js index b521d8f8f..1c7c32af2 100644 --- a/samples/generated/v1beta1/document_understanding_service.batch_process_documents.js +++ b/samples/generated/v1beta1/document_understanding_service.batch_process_documents.js @@ -23,6 +23,9 @@ function main(requests) { // [START documentai_v1beta1_generated_DocumentUnderstandingService_BatchProcessDocuments_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.documentai.v1beta1.json b/samples/generated/v1beta1/snippet_metadata.google.cloud.documentai.v1beta1.json index 72bcd115a..753d665ed 100644 --- a/samples/generated/v1beta1/snippet_metadata.google.cloud.documentai.v1beta1.json +++ b/samples/generated/v1beta1/snippet_metadata.google.cloud.documentai.v1beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], diff --git a/samples/generated/v1beta2/document_understanding_service.batch_process_documents.js b/samples/generated/v1beta2/document_understanding_service.batch_process_documents.js index 8b2ab19f5..d8b7a1970 100644 --- a/samples/generated/v1beta2/document_understanding_service.batch_process_documents.js +++ b/samples/generated/v1beta2/document_understanding_service.batch_process_documents.js @@ -23,6 +23,9 @@ function main(requests) { // [START documentai_v1beta2_generated_DocumentUnderstandingService_BatchProcessDocuments_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/v1beta2/document_understanding_service.process_document.js b/samples/generated/v1beta2/document_understanding_service.process_document.js index f689731c7..caf92fe34 100644 --- a/samples/generated/v1beta2/document_understanding_service.process_document.js +++ b/samples/generated/v1beta2/document_understanding_service.process_document.js @@ -23,6 +23,9 @@ function main(inputConfig) { // [START documentai_v1beta2_generated_DocumentUnderstandingService_ProcessDocument_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/v1beta2/snippet_metadata.google.cloud.documentai.v1beta2.json b/samples/generated/v1beta2/snippet_metadata.google.cloud.documentai.v1beta2.json index 8461a1e05..8583d8254 100644 --- a/samples/generated/v1beta2/snippet_metadata.google.cloud.documentai.v1beta2.json +++ b/samples/generated/v1beta2/snippet_metadata.google.cloud.documentai.v1beta2.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], @@ -66,7 +66,7 @@ "segments": [ { "start": 25, - "end": 93, + "end": 96, "type": "FULL" } ], diff --git a/samples/generated/v1beta3/document_processor_service.batch_process_documents.js b/samples/generated/v1beta3/document_processor_service.batch_process_documents.js index e03908b58..25bd5f659 100644 --- a/samples/generated/v1beta3/document_processor_service.batch_process_documents.js +++ b/samples/generated/v1beta3/document_processor_service.batch_process_documents.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_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/v1beta3/document_processor_service.create_processor.js b/samples/generated/v1beta3/document_processor_service.create_processor.js index 050feab29..fc1916f0a 100644 --- a/samples/generated/v1beta3/document_processor_service.create_processor.js +++ b/samples/generated/v1beta3/document_processor_service.create_processor.js @@ -23,6 +23,9 @@ function main(parent, processor) { // [START documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_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/v1beta3/document_processor_service.delete_processor.js b/samples/generated/v1beta3/document_processor_service.delete_processor.js index 23228e139..ae5e7227c 100644 --- a/samples/generated/v1beta3/document_processor_service.delete_processor.js +++ b/samples/generated/v1beta3/document_processor_service.delete_processor.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_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/v1beta3/document_processor_service.delete_processor_version.js b/samples/generated/v1beta3/document_processor_service.delete_processor_version.js index b0503d648..a2c34c8be 100644 --- a/samples/generated/v1beta3/document_processor_service.delete_processor_version.js +++ b/samples/generated/v1beta3/document_processor_service.delete_processor_version.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_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/v1beta3/document_processor_service.deploy_processor_version.js b/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js index e1dfce344..416d46b66 100644 --- a/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js +++ b/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_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/v1beta3/document_processor_service.disable_processor.js b/samples/generated/v1beta3/document_processor_service.disable_processor.js index 219f687ea..2fa77f790 100644 --- a/samples/generated/v1beta3/document_processor_service.disable_processor.js +++ b/samples/generated/v1beta3/document_processor_service.disable_processor.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_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/v1beta3/document_processor_service.enable_processor.js b/samples/generated/v1beta3/document_processor_service.enable_processor.js index 88e78e8d9..e2ee9079f 100644 --- a/samples/generated/v1beta3/document_processor_service.enable_processor.js +++ b/samples/generated/v1beta3/document_processor_service.enable_processor.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_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/v1beta3/document_processor_service.fetch_processor_types.js b/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js index 15b6348f3..4fc8c1275 100644 --- a/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js +++ b/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js @@ -23,6 +23,9 @@ function main(parent) { // [START documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_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/v1beta3/document_processor_service.get_processor.js b/samples/generated/v1beta3/document_processor_service.get_processor.js index c265c6bf6..4b89803a0 100644 --- a/samples/generated/v1beta3/document_processor_service.get_processor.js +++ b/samples/generated/v1beta3/document_processor_service.get_processor.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_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/v1beta3/document_processor_service.get_processor_version.js b/samples/generated/v1beta3/document_processor_service.get_processor_version.js index 979a477cc..9c30f2d02 100644 --- a/samples/generated/v1beta3/document_processor_service.get_processor_version.js +++ b/samples/generated/v1beta3/document_processor_service.get_processor_version.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_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/v1beta3/document_processor_service.list_processor_types.js b/samples/generated/v1beta3/document_processor_service.list_processor_types.js index 681610ead..7500d1d6d 100644 --- a/samples/generated/v1beta3/document_processor_service.list_processor_types.js +++ b/samples/generated/v1beta3/document_processor_service.list_processor_types.js @@ -23,6 +23,9 @@ function main(parent) { // [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_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/v1beta3/document_processor_service.list_processor_versions.js b/samples/generated/v1beta3/document_processor_service.list_processor_versions.js index af97f27e4..c922f46fa 100644 --- a/samples/generated/v1beta3/document_processor_service.list_processor_versions.js +++ b/samples/generated/v1beta3/document_processor_service.list_processor_versions.js @@ -23,6 +23,9 @@ function main(parent) { // [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_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/v1beta3/document_processor_service.list_processors.js b/samples/generated/v1beta3/document_processor_service.list_processors.js index 4012d0b7a..c136a8023 100644 --- a/samples/generated/v1beta3/document_processor_service.list_processors.js +++ b/samples/generated/v1beta3/document_processor_service.list_processors.js @@ -23,6 +23,9 @@ function main(parent) { // [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_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/v1beta3/document_processor_service.process_document.js b/samples/generated/v1beta3/document_processor_service.process_document.js index 9e37ab06e..1a6657cab 100644 --- a/samples/generated/v1beta3/document_processor_service.process_document.js +++ b/samples/generated/v1beta3/document_processor_service.process_document.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_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/v1beta3/document_processor_service.review_document.js b/samples/generated/v1beta3/document_processor_service.review_document.js index 8c3bb7571..cb7b942ae 100644 --- a/samples/generated/v1beta3/document_processor_service.review_document.js +++ b/samples/generated/v1beta3/document_processor_service.review_document.js @@ -23,6 +23,9 @@ function main(humanReviewConfig) { // [START documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_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/v1beta3/document_processor_service.set_default_processor_version.js b/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js index 42909b970..44d9177db 100644 --- a/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js +++ b/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js @@ -23,6 +23,9 @@ function main(processor, defaultProcessorVersion) { // [START documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_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/v1beta3/document_processor_service.undeploy_processor_version.js b/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js index 05957013c..6bc7a006f 100644 --- a/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js +++ b/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js @@ -23,6 +23,9 @@ function main(name) { // [START documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_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/v1beta3/snippet_metadata.google.cloud.documentai.v1beta3.json b/samples/generated/v1beta3/snippet_metadata.google.cloud.documentai.v1beta3.json index 6657b6d29..8d3945829 100644 --- a/samples/generated/v1beta3/snippet_metadata.google.cloud.documentai.v1beta3.json +++ b/samples/generated/v1beta3/snippet_metadata.google.cloud.documentai.v1beta3.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 76, + "end": 79, "type": "FULL" } ], @@ -82,7 +82,7 @@ "segments": [ { "start": 25, - "end": 76, + "end": 79, "type": "FULL" } ], @@ -142,7 +142,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -182,7 +182,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -230,7 +230,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -278,7 +278,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -318,7 +318,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -358,7 +358,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -406,7 +406,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -446,7 +446,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -486,7 +486,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -526,7 +526,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], @@ -570,7 +570,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -610,7 +610,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -650,7 +650,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -690,7 +690,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 61, "type": "FULL" } ], @@ -734,7 +734,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 75, "type": "FULL" } ], diff --git a/src/v1/document_processor_service_client.ts b/src/v1/document_processor_service_client.ts index e3293a1ac..a07ef2ce6 100644 --- a/src/v1/document_processor_service_client.ts +++ b/src/v1/document_processor_service_client.ts @@ -32,7 +32,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'); /** @@ -477,7 +476,8 @@ export class DocumentProcessorServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1145,7 +1145,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.batchProcessDocuments, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.documentai.v1.BatchProcessResponse, @@ -1287,7 +1287,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteProcessorVersion, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1428,7 +1428,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deployProcessorVersion, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.documentai.v1.DeployProcessorVersionResponse, @@ -1569,7 +1569,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.undeployProcessorVersion, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.documentai.v1.UndeployProcessorVersionResponse, @@ -1707,7 +1707,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteProcessor, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1844,7 +1844,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.enableProcessor, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.documentai.v1.EnableProcessorResponse, @@ -1981,7 +1981,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.disableProcessor, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.documentai.v1.DisableProcessorResponse, @@ -2128,7 +2128,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.setDefaultProcessorVersion, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse, @@ -2275,7 +2275,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.reviewDocument, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.documentai.v1.ReviewDocumentResponse, @@ -2427,7 +2427,7 @@ export class DocumentProcessorServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listProcessorTypes.createStream( - this.innerApiCalls.listProcessorTypes as gax.GaxCall, + this.innerApiCalls.listProcessorTypes as GaxCall, request, callSettings ); @@ -2479,7 +2479,7 @@ export class DocumentProcessorServiceClient { this.initialize(); return this.descriptors.page.listProcessorTypes.asyncIterate( this.innerApiCalls['listProcessorTypes'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2628,7 +2628,7 @@ export class DocumentProcessorServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listProcessors.createStream( - this.innerApiCalls.listProcessors as gax.GaxCall, + this.innerApiCalls.listProcessors as GaxCall, request, callSettings ); @@ -2680,7 +2680,7 @@ export class DocumentProcessorServiceClient { this.initialize(); return this.descriptors.page.listProcessors.asyncIterate( this.innerApiCalls['listProcessors'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2829,7 +2829,7 @@ export class DocumentProcessorServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listProcessorVersions.createStream( - this.innerApiCalls.listProcessorVersions as gax.GaxCall, + this.innerApiCalls.listProcessorVersions as GaxCall, request, callSettings ); @@ -2881,7 +2881,7 @@ export class DocumentProcessorServiceClient { this.initialize(); return this.descriptors.page.listProcessorVersions.asyncIterate( this.innerApiCalls['listProcessorVersions'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/src/v1beta1/document_understanding_service_client.ts b/src/v1beta1/document_understanding_service_client.ts index 85e83bdb9..5ea7ee871 100644 --- a/src/v1beta1/document_understanding_service_client.ts +++ b/src/v1beta1/document_understanding_service_client.ts @@ -257,7 +257,8 @@ export class DocumentUnderstandingServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -456,7 +457,7 @@ export class DocumentUnderstandingServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.batchProcessDocuments, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.documentai.v1beta1.BatchProcessDocumentsResponse, diff --git a/src/v1beta2/document_understanding_service_client.ts b/src/v1beta2/document_understanding_service_client.ts index fd7b71fec..492b234d0 100644 --- a/src/v1beta2/document_understanding_service_client.ts +++ b/src/v1beta2/document_understanding_service_client.ts @@ -260,7 +260,8 @@ export class DocumentUnderstandingServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -586,7 +587,7 @@ export class DocumentUnderstandingServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.batchProcessDocuments, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse, diff --git a/src/v1beta3/document_processor_service_client.ts b/src/v1beta3/document_processor_service_client.ts index d3c447799..d9aa8aca5 100644 --- a/src/v1beta3/document_processor_service_client.ts +++ b/src/v1beta3/document_processor_service_client.ts @@ -32,7 +32,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'); /** @@ -476,7 +475,8 @@ export class DocumentProcessorServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1176,7 +1176,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.batchProcessDocuments, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.documentai.v1beta3.BatchProcessResponse, @@ -1318,7 +1318,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteProcessorVersion, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1459,7 +1459,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deployProcessorVersion, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse, @@ -1600,7 +1600,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.undeployProcessorVersion, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse, @@ -1738,7 +1738,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteProcessor, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1875,7 +1875,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.enableProcessor, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.documentai.v1beta3.EnableProcessorResponse, @@ -2012,7 +2012,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.disableProcessor, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.documentai.v1beta3.DisableProcessorResponse, @@ -2159,7 +2159,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.setDefaultProcessorVersion, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse, @@ -2308,7 +2308,7 @@ export class DocumentProcessorServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.reviewDocument, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.documentai.v1beta3.ReviewDocumentResponse, @@ -2460,7 +2460,7 @@ export class DocumentProcessorServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listProcessorTypes.createStream( - this.innerApiCalls.listProcessorTypes as gax.GaxCall, + this.innerApiCalls.listProcessorTypes as GaxCall, request, callSettings ); @@ -2512,7 +2512,7 @@ export class DocumentProcessorServiceClient { this.initialize(); return this.descriptors.page.listProcessorTypes.asyncIterate( this.innerApiCalls['listProcessorTypes'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2661,7 +2661,7 @@ export class DocumentProcessorServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listProcessors.createStream( - this.innerApiCalls.listProcessors as gax.GaxCall, + this.innerApiCalls.listProcessors as GaxCall, request, callSettings ); @@ -2713,7 +2713,7 @@ export class DocumentProcessorServiceClient { this.initialize(); return this.descriptors.page.listProcessors.asyncIterate( this.innerApiCalls['listProcessors'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2862,7 +2862,7 @@ export class DocumentProcessorServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listProcessorVersions.createStream( - this.innerApiCalls.listProcessorVersions as gax.GaxCall, + this.innerApiCalls.listProcessorVersions as GaxCall, request, callSettings ); @@ -2914,7 +2914,7 @@ export class DocumentProcessorServiceClient { this.initialize(); return this.descriptors.page.listProcessorVersions.asyncIterate( this.innerApiCalls['listProcessorVersions'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/test/gapic_document_processor_service_v1.ts b/test/gapic_document_processor_service_v1.ts index 83450a643..0a56ba9cb 100644 --- a/test/gapic_document_processor_service_v1.ts +++ b/test/gapic_document_processor_service_v1.ts @@ -150,111 +150,113 @@ function stubAsyncIterationCall( } describe('v1.DocumentProcessorServiceClient', () => { - it('has servicePath', () => { - const servicePath = - documentprocessorserviceModule.v1.DocumentProcessorServiceClient - .servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + documentprocessorserviceModule.v1.DocumentProcessorServiceClient + .servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - documentprocessorserviceModule.v1.DocumentProcessorServiceClient - .apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + documentprocessorserviceModule.v1.DocumentProcessorServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - documentprocessorserviceModule.v1.DocumentProcessorServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + documentprocessorserviceModule.v1.DocumentProcessorServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new documentprocessorserviceModule.v1.DocumentProcessorServiceClient(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new documentprocessorserviceModule.v1.DocumentProcessorServiceClient(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - fallback: true, - }); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + fallback: true, + }); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.documentProcessorServiceStub, undefined); - await client.initialize(); - assert(client.documentProcessorServiceStub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.documentProcessorServiceStub, undefined); + await client.initialize(); + assert(client.documentProcessorServiceStub); + }); - it('has close method for the initialized client', done => { - const client = - new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = + new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.documentProcessorServiceStub); + client.close().then(() => { + done(); }); - client.initialize(); - assert(client.documentProcessorServiceStub); - client.close().then(() => { - done(); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = + new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.documentProcessorServiceStub, undefined); + client.close().then(() => { + done(); }); - assert.strictEqual(client.documentProcessorServiceStub, undefined); - client.close().then(() => { - done(); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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('processDocument', () => { diff --git a/test/gapic_document_processor_service_v1beta3.ts b/test/gapic_document_processor_service_v1beta3.ts index 0e1e515df..b0e9bbf52 100644 --- a/test/gapic_document_processor_service_v1beta3.ts +++ b/test/gapic_document_processor_service_v1beta3.ts @@ -150,124 +150,126 @@ function stubAsyncIterationCall( } describe('v1beta3.DocumentProcessorServiceClient', () => { - it('has servicePath', () => { - const servicePath = - documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient - .servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient + .servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient - .apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient - .port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient( - { - fallback: true, - } - ); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient( + { + fallback: true, + } + ); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.documentProcessorServiceStub, undefined); - await client.initialize(); - assert(client.documentProcessorServiceStub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.documentProcessorServiceStub, undefined); + await client.initialize(); + assert(client.documentProcessorServiceStub); + }); - it('has close method for the initialized client', done => { - const client = - new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - assert(client.documentProcessorServiceStub); - client.close().then(() => { - done(); + it('has close method for the initialized client', done => { + const client = + new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.documentProcessorServiceStub); + client.close().then(() => { + done(); + }); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.documentProcessorServiceStub, undefined); - client.close().then(() => { - done(); + it('has close method for the non-initialized client', done => { + const client = + new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.documentProcessorServiceStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient( - { - 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', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient( + { + 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient( - { - 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient( + { + 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('processDocument', () => { diff --git a/test/gapic_document_understanding_service_v1beta1.ts b/test/gapic_document_understanding_service_v1beta1.ts index 521250e72..bd1b6eba3 100644 --- a/test/gapic_document_understanding_service_v1beta1.ts +++ b/test/gapic_document_understanding_service_v1beta1.ts @@ -73,124 +73,126 @@ function stubLongRunningCallWithCallback( } describe('v1beta1.DocumentUnderstandingServiceClient', () => { - it('has servicePath', () => { - const servicePath = - documentunderstandingserviceModule.v1beta1 - .DocumentUnderstandingServiceClient.servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + documentunderstandingserviceModule.v1beta1 + .DocumentUnderstandingServiceClient.servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - documentunderstandingserviceModule.v1beta1 - .DocumentUnderstandingServiceClient.apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + documentunderstandingserviceModule.v1beta1 + .DocumentUnderstandingServiceClient.apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - documentunderstandingserviceModule.v1beta1 - .DocumentUnderstandingServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + documentunderstandingserviceModule.v1beta1 + .DocumentUnderstandingServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new documentunderstandingserviceModule.v1beta1.DocumentUnderstandingServiceClient(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new documentunderstandingserviceModule.v1beta1.DocumentUnderstandingServiceClient(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new documentunderstandingserviceModule.v1beta1.DocumentUnderstandingServiceClient( - { - fallback: true, - } - ); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new documentunderstandingserviceModule.v1beta1.DocumentUnderstandingServiceClient( + { + fallback: true, + } + ); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new documentunderstandingserviceModule.v1beta1.DocumentUnderstandingServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.documentUnderstandingServiceStub, undefined); - await client.initialize(); - assert(client.documentUnderstandingServiceStub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new documentunderstandingserviceModule.v1beta1.DocumentUnderstandingServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.documentUnderstandingServiceStub, undefined); + await client.initialize(); + assert(client.documentUnderstandingServiceStub); + }); - it('has close method for the initialized client', done => { - const client = - new documentunderstandingserviceModule.v1beta1.DocumentUnderstandingServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - assert(client.documentUnderstandingServiceStub); - client.close().then(() => { - done(); + it('has close method for the initialized client', done => { + const client = + new documentunderstandingserviceModule.v1beta1.DocumentUnderstandingServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.documentUnderstandingServiceStub); + client.close().then(() => { + done(); + }); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new documentunderstandingserviceModule.v1beta1.DocumentUnderstandingServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.documentUnderstandingServiceStub, undefined); - client.close().then(() => { - done(); + it('has close method for the non-initialized client', done => { + const client = + new documentunderstandingserviceModule.v1beta1.DocumentUnderstandingServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.documentUnderstandingServiceStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new documentunderstandingserviceModule.v1beta1.DocumentUnderstandingServiceClient( - { - 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', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new documentunderstandingserviceModule.v1beta1.DocumentUnderstandingServiceClient( + { + 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 documentunderstandingserviceModule.v1beta1.DocumentUnderstandingServiceClient( - { - 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 documentunderstandingserviceModule.v1beta1.DocumentUnderstandingServiceClient( + { + 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('batchProcessDocuments', () => { diff --git a/test/gapic_document_understanding_service_v1beta2.ts b/test/gapic_document_understanding_service_v1beta2.ts index 6feb89ff2..ff88e78d0 100644 --- a/test/gapic_document_understanding_service_v1beta2.ts +++ b/test/gapic_document_understanding_service_v1beta2.ts @@ -82,124 +82,126 @@ function stubLongRunningCallWithCallback( } describe('v1beta2.DocumentUnderstandingServiceClient', () => { - it('has servicePath', () => { - const servicePath = - documentunderstandingserviceModule.v1beta2 - .DocumentUnderstandingServiceClient.servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + documentunderstandingserviceModule.v1beta2 + .DocumentUnderstandingServiceClient.servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - documentunderstandingserviceModule.v1beta2 - .DocumentUnderstandingServiceClient.apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + documentunderstandingserviceModule.v1beta2 + .DocumentUnderstandingServiceClient.apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - documentunderstandingserviceModule.v1beta2 - .DocumentUnderstandingServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + documentunderstandingserviceModule.v1beta2 + .DocumentUnderstandingServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new documentunderstandingserviceModule.v1beta2.DocumentUnderstandingServiceClient(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new documentunderstandingserviceModule.v1beta2.DocumentUnderstandingServiceClient(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new documentunderstandingserviceModule.v1beta2.DocumentUnderstandingServiceClient( - { - fallback: true, - } - ); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new documentunderstandingserviceModule.v1beta2.DocumentUnderstandingServiceClient( + { + fallback: true, + } + ); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new documentunderstandingserviceModule.v1beta2.DocumentUnderstandingServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.documentUnderstandingServiceStub, undefined); - await client.initialize(); - assert(client.documentUnderstandingServiceStub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new documentunderstandingserviceModule.v1beta2.DocumentUnderstandingServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.documentUnderstandingServiceStub, undefined); + await client.initialize(); + assert(client.documentUnderstandingServiceStub); + }); - it('has close method for the initialized client', done => { - const client = - new documentunderstandingserviceModule.v1beta2.DocumentUnderstandingServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - assert(client.documentUnderstandingServiceStub); - client.close().then(() => { - done(); + it('has close method for the initialized client', done => { + const client = + new documentunderstandingserviceModule.v1beta2.DocumentUnderstandingServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.documentUnderstandingServiceStub); + client.close().then(() => { + done(); + }); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new documentunderstandingserviceModule.v1beta2.DocumentUnderstandingServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.documentUnderstandingServiceStub, undefined); - client.close().then(() => { - done(); + it('has close method for the non-initialized client', done => { + const client = + new documentunderstandingserviceModule.v1beta2.DocumentUnderstandingServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.documentUnderstandingServiceStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new documentunderstandingserviceModule.v1beta2.DocumentUnderstandingServiceClient( - { - 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', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new documentunderstandingserviceModule.v1beta2.DocumentUnderstandingServiceClient( + { + 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 documentunderstandingserviceModule.v1beta2.DocumentUnderstandingServiceClient( - { - 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 documentunderstandingserviceModule.v1beta2.DocumentUnderstandingServiceClient( + { + 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('processDocument', () => {