diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.create_attestor.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.create_attestor.js index 1499dc50265..9cc300ee3b6 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.create_attestor.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.create_attestor.js @@ -23,6 +23,9 @@ function main(parent, attestorId, attestor) { // [START binaryauthorization_v1_generated_BinauthzManagementServiceV1_CreateAttestor_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/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.delete_attestor.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.delete_attestor.js index e25decb6c30..15105c9238d 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.delete_attestor.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.delete_attestor.js @@ -23,6 +23,9 @@ function main(name) { // [START binaryauthorization_v1_generated_BinauthzManagementServiceV1_DeleteAttestor_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/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.get_attestor.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.get_attestor.js index 98295e2b834..0e369fe3bc7 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.get_attestor.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.get_attestor.js @@ -23,6 +23,9 @@ function main(name) { // [START binaryauthorization_v1_generated_BinauthzManagementServiceV1_GetAttestor_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/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.get_policy.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.get_policy.js index bc8f4f6a6a4..90540a4598b 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.get_policy.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.get_policy.js @@ -23,6 +23,9 @@ function main(name) { // [START binaryauthorization_v1_generated_BinauthzManagementServiceV1_GetPolicy_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/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.list_attestors.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.list_attestors.js index aebdf8c6091..6ac605ab8fe 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.list_attestors.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.list_attestors.js @@ -23,6 +23,9 @@ function main(parent) { // [START binaryauthorization_v1_generated_BinauthzManagementServiceV1_ListAttestors_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/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.update_attestor.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.update_attestor.js index 6c5acdca6fc..35683da1967 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.update_attestor.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.update_attestor.js @@ -23,6 +23,9 @@ function main(attestor) { // [START binaryauthorization_v1_generated_BinauthzManagementServiceV1_UpdateAttestor_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/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.update_policy.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.update_policy.js index c70c3a6699b..b9873b56f02 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.update_policy.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.update_policy.js @@ -23,6 +23,9 @@ function main(policy) { // [START binaryauthorization_v1_generated_BinauthzManagementServiceV1_UpdatePolicy_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/packages/google-cloud-binaryauthorization/samples/generated/v1/snippet_metadata.google.cloud.binaryauthorization.v1.json b/packages/google-cloud-binaryauthorization/samples/generated/v1/snippet_metadata.google.cloud.binaryauthorization.v1.json index 1285178a8b8..4001babed5d 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/snippet_metadata.google.cloud.binaryauthorization.v1.json +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/snippet_metadata.google.cloud.binaryauthorization.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -62,7 +62,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -102,7 +102,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -150,7 +150,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -190,7 +190,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -230,7 +230,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -278,7 +278,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -318,7 +318,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -358,7 +358,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 75, "type": "FULL" } ], diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1/system_policy_v1.get_system_policy.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/system_policy_v1.get_system_policy.js index d749cd7db3b..ce4d36070ac 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/system_policy_v1.get_system_policy.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/system_policy_v1.get_system_policy.js @@ -23,6 +23,9 @@ function main(name) { // [START binaryauthorization_v1_generated_SystemPolicyV1_GetSystemPolicy_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/packages/google-cloud-binaryauthorization/samples/generated/v1/validation_helper_v1.validate_attestation_occurrence.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/validation_helper_v1.validate_attestation_occurrence.js index ff236be665c..9927d0dc995 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/validation_helper_v1.validate_attestation_occurrence.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/validation_helper_v1.validate_attestation_occurrence.js @@ -23,6 +23,9 @@ function main(attestor, attestation, occurrenceNote, occurrenceResourceUri) { // [START binaryauthorization_v1_generated_ValidationHelperV1_ValidateAttestationOccurrence_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/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.create_attestor.js b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.create_attestor.js index 83c48c7425e..32a02658c11 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.create_attestor.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.create_attestor.js @@ -23,6 +23,9 @@ function main(parent, attestorId, attestor) { // [START binaryauthorization_v1beta1_generated_BinauthzManagementServiceV1Beta1_CreateAttestor_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/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.delete_attestor.js b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.delete_attestor.js index 0f439cf5697..441f3ed907a 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.delete_attestor.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.delete_attestor.js @@ -23,6 +23,9 @@ function main(name) { // [START binaryauthorization_v1beta1_generated_BinauthzManagementServiceV1Beta1_DeleteAttestor_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/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_attestor.js b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_attestor.js index 85719a87f1d..de46ed31b43 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_attestor.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_attestor.js @@ -23,6 +23,9 @@ function main(name) { // [START binaryauthorization_v1beta1_generated_BinauthzManagementServiceV1Beta1_GetAttestor_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/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_policy.js b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_policy.js index ce84d2df935..6996266bbaf 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_policy.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_policy.js @@ -23,6 +23,9 @@ function main(name) { // [START binaryauthorization_v1beta1_generated_BinauthzManagementServiceV1Beta1_GetPolicy_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/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.list_attestors.js b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.list_attestors.js index 0023d6455ad..a306cb8cac5 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.list_attestors.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.list_attestors.js @@ -23,6 +23,9 @@ function main(parent) { // [START binaryauthorization_v1beta1_generated_BinauthzManagementServiceV1Beta1_ListAttestors_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/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_attestor.js b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_attestor.js index 8dbc0d18cea..79700f84042 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_attestor.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_attestor.js @@ -23,6 +23,9 @@ function main(attestor) { // [START binaryauthorization_v1beta1_generated_BinauthzManagementServiceV1Beta1_UpdateAttestor_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/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_policy.js b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_policy.js index 12aa0a0a748..1309519807b 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_policy.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_policy.js @@ -23,6 +23,9 @@ function main(policy) { // [START binaryauthorization_v1beta1_generated_BinauthzManagementServiceV1Beta1_UpdatePolicy_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/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/snippet_metadata.google.cloud.binaryauthorization.v1beta1.json b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/snippet_metadata.google.cloud.binaryauthorization.v1beta1.json index fcd9f8dbb16..216b6e2c444 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/snippet_metadata.google.cloud.binaryauthorization.v1beta1.json +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/snippet_metadata.google.cloud.binaryauthorization.v1beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -62,7 +62,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -102,7 +102,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -150,7 +150,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -190,7 +190,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -230,7 +230,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -278,7 +278,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -318,7 +318,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/system_policy_v1_beta1.get_system_policy.js b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/system_policy_v1_beta1.get_system_policy.js index e64583a7b9c..c02feb19d17 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/system_policy_v1_beta1.get_system_policy.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/system_policy_v1_beta1.get_system_policy.js @@ -23,6 +23,9 @@ function main(name) { // [START binaryauthorization_v1beta1_generated_SystemPolicyV1Beta1_GetSystemPolicy_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/packages/google-cloud-binaryauthorization/src/v1/binauthz_management_service_v1_client.ts b/packages/google-cloud-binaryauthorization/src/v1/binauthz_management_service_v1_client.ts index 564eec24f5a..70213cf6cd3 100644 --- a/packages/google-cloud-binaryauthorization/src/v1/binauthz_management_service_v1_client.ts +++ b/packages/google-cloud-binaryauthorization/src/v1/binauthz_management_service_v1_client.ts @@ -28,7 +28,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'); /** @@ -273,7 +272,8 @@ export class BinauthzManagementServiceV1Client { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1087,7 +1087,7 @@ export class BinauthzManagementServiceV1Client { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAttestors.createStream( - this.innerApiCalls.listAttestors as gax.GaxCall, + this.innerApiCalls.listAttestors as GaxCall, request, callSettings ); @@ -1139,7 +1139,7 @@ export class BinauthzManagementServiceV1Client { this.initialize(); return this.descriptors.page.listAttestors.asyncIterate( this.innerApiCalls['listAttestors'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-binaryauthorization/src/v1/system_policy_v1_client.ts b/packages/google-cloud-binaryauthorization/src/v1/system_policy_v1_client.ts index 12ad9376cd5..e951c8f8931 100644 --- a/packages/google-cloud-binaryauthorization/src/v1/system_policy_v1_client.ts +++ b/packages/google-cloud-binaryauthorization/src/v1/system_policy_v1_client.ts @@ -238,7 +238,8 @@ export class SystemPolicyV1Client { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-binaryauthorization/src/v1/validation_helper_v1_client.ts b/packages/google-cloud-binaryauthorization/src/v1/validation_helper_v1_client.ts index c944f4944fc..12900a955bb 100644 --- a/packages/google-cloud-binaryauthorization/src/v1/validation_helper_v1_client.ts +++ b/packages/google-cloud-binaryauthorization/src/v1/validation_helper_v1_client.ts @@ -238,7 +238,8 @@ export class ValidationHelperV1Client { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-binaryauthorization/src/v1beta1/binauthz_management_service_v1_beta1_client.ts b/packages/google-cloud-binaryauthorization/src/v1beta1/binauthz_management_service_v1_beta1_client.ts index 084c4727959..7cc803db707 100644 --- a/packages/google-cloud-binaryauthorization/src/v1beta1/binauthz_management_service_v1_beta1_client.ts +++ b/packages/google-cloud-binaryauthorization/src/v1beta1/binauthz_management_service_v1_beta1_client.ts @@ -28,7 +28,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'); /** @@ -273,7 +272,8 @@ export class BinauthzManagementServiceV1Beta1Client { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1093,7 +1093,7 @@ export class BinauthzManagementServiceV1Beta1Client { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAttestors.createStream( - this.innerApiCalls.listAttestors as gax.GaxCall, + this.innerApiCalls.listAttestors as GaxCall, request, callSettings ); @@ -1145,7 +1145,7 @@ export class BinauthzManagementServiceV1Beta1Client { this.initialize(); return this.descriptors.page.listAttestors.asyncIterate( this.innerApiCalls['listAttestors'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-binaryauthorization/src/v1beta1/system_policy_v1_beta1_client.ts b/packages/google-cloud-binaryauthorization/src/v1beta1/system_policy_v1_beta1_client.ts index dbd339c893a..17b0f2e5407 100644 --- a/packages/google-cloud-binaryauthorization/src/v1beta1/system_policy_v1_beta1_client.ts +++ b/packages/google-cloud-binaryauthorization/src/v1beta1/system_policy_v1_beta1_client.ts @@ -238,7 +238,8 @@ export class SystemPolicyV1Beta1Client { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-binaryauthorization/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts b/packages/google-cloud-binaryauthorization/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts index 73c275b71c9..6e8197a9a74 100644 --- a/packages/google-cloud-binaryauthorization/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-binaryauthorization/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts @@ -113,124 +113,132 @@ function stubAsyncIterationCall( } describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { - it('has servicePath', () => { - const servicePath = - binauthzmanagementservicev1beta1Module.v1beta1 - .BinauthzManagementServiceV1Beta1Client.servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + binauthzmanagementservicev1beta1Module.v1beta1 + .BinauthzManagementServiceV1Beta1Client.servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - binauthzmanagementservicev1beta1Module.v1beta1 - .BinauthzManagementServiceV1Beta1Client.apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + binauthzmanagementservicev1beta1Module.v1beta1 + .BinauthzManagementServiceV1Beta1Client.apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - binauthzmanagementservicev1beta1Module.v1beta1 - .BinauthzManagementServiceV1Beta1Client.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + binauthzmanagementservicev1beta1Module.v1beta1 + .BinauthzManagementServiceV1Beta1Client.port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( - { - fallback: true, - } - ); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( + { + fallback: true, + } + ); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } + it('has initialize method and supports deferred initialization', async () => { + const client = + new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual( + client.binauthzManagementServiceV1Beta1Stub, + undefined ); - assert.strictEqual(client.binauthzManagementServiceV1Beta1Stub, undefined); - await client.initialize(); - assert(client.binauthzManagementServiceV1Beta1Stub); - }); + await client.initialize(); + assert(client.binauthzManagementServiceV1Beta1Stub); + }); - it('has close method for the initialized client', done => { - const client = - new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - assert(client.binauthzManagementServiceV1Beta1Stub); - client.close().then(() => { - done(); + it('has close method for the initialized client', done => { + const client = + new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.binauthzManagementServiceV1Beta1Stub); + client.close().then(() => { + done(); + }); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } + it('has close method for the non-initialized client', done => { + const client = + new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual( + client.binauthzManagementServiceV1Beta1Stub, + undefined ); - assert.strictEqual(client.binauthzManagementServiceV1Beta1Stub, undefined); - client.close().then(() => { - done(); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( - { - 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 binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( + { + 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 binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( - { - 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 binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( + { + 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('getPolicy', () => { diff --git a/packages/google-cloud-binaryauthorization/test/gapic_binauthz_management_service_v1_v1.ts b/packages/google-cloud-binaryauthorization/test/gapic_binauthz_management_service_v1_v1.ts index d99cae816ff..bd51794cce0 100644 --- a/packages/google-cloud-binaryauthorization/test/gapic_binauthz_management_service_v1_v1.ts +++ b/packages/google-cloud-binaryauthorization/test/gapic_binauthz_management_service_v1_v1.ts @@ -113,124 +113,126 @@ function stubAsyncIterationCall( } describe('v1.BinauthzManagementServiceV1Client', () => { - it('has servicePath', () => { - const servicePath = - binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client - .servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client + .servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client - .apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client + .apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client - .port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client + .port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( - { - fallback: true, - } - ); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( + { + fallback: true, + } + ); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.binauthzManagementServiceV1Stub, undefined); - await client.initialize(); - assert(client.binauthzManagementServiceV1Stub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.binauthzManagementServiceV1Stub, undefined); + await client.initialize(); + assert(client.binauthzManagementServiceV1Stub); + }); - it('has close method for the initialized client', done => { - const client = - new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - assert(client.binauthzManagementServiceV1Stub); - client.close().then(() => { - done(); + it('has close method for the initialized client', done => { + const client = + new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.binauthzManagementServiceV1Stub); + client.close().then(() => { + done(); + }); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.binauthzManagementServiceV1Stub, undefined); - client.close().then(() => { - done(); + it('has close method for the non-initialized client', done => { + const client = + new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.binauthzManagementServiceV1Stub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( - { - 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 binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( + { + 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 binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( - { - 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 binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( + { + 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('getPolicy', () => { diff --git a/packages/google-cloud-binaryauthorization/test/gapic_system_policy_v1_beta1_v1beta1.ts b/packages/google-cloud-binaryauthorization/test/gapic_system_policy_v1_beta1_v1beta1.ts index c4f852d44e0..e54f1794750 100644 --- a/packages/google-cloud-binaryauthorization/test/gapic_system_policy_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-binaryauthorization/test/gapic_system_policy_v1_beta1_v1beta1.ts @@ -50,109 +50,111 @@ function stubSimpleCallWithCallback( } describe('v1beta1.SystemPolicyV1Beta1Client', () => { - it('has servicePath', () => { - const servicePath = - systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client.servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client.servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client.apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client.apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client.port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ - fallback: true, - }); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ + fallback: true, + }); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.systemPolicyV1Beta1Stub, undefined); - await client.initialize(); - assert(client.systemPolicyV1Beta1Stub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.systemPolicyV1Beta1Stub, undefined); + await client.initialize(); + assert(client.systemPolicyV1Beta1Stub); + }); - it('has close method for the initialized client', done => { - const client = - new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = + new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.systemPolicyV1Beta1Stub); + client.close().then(() => { + done(); }); - client.initialize(); - assert(client.systemPolicyV1Beta1Stub); - client.close().then(() => { - done(); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = + new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.systemPolicyV1Beta1Stub, undefined); + client.close().then(() => { + done(); }); - assert.strictEqual(client.systemPolicyV1Beta1Stub, undefined); - client.close().then(() => { - done(); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ - 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 systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ + 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 systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ - 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 systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ + 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('getSystemPolicy', () => { diff --git a/packages/google-cloud-binaryauthorization/test/gapic_system_policy_v1_v1.ts b/packages/google-cloud-binaryauthorization/test/gapic_system_policy_v1_v1.ts index 805a3352fc3..e8d62834d6f 100644 --- a/packages/google-cloud-binaryauthorization/test/gapic_system_policy_v1_v1.ts +++ b/packages/google-cloud-binaryauthorization/test/gapic_system_policy_v1_v1.ts @@ -50,101 +50,103 @@ function stubSimpleCallWithCallback( } describe('v1.SystemPolicyV1Client', () => { - it('has servicePath', () => { - const servicePath = - systempolicyv1Module.v1.SystemPolicyV1Client.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - systempolicyv1Module.v1.SystemPolicyV1Client.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = systempolicyv1Module.v1.SystemPolicyV1Client.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new systempolicyv1Module.v1.SystemPolicyV1Client(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + systempolicyv1Module.v1.SystemPolicyV1Client.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = + systempolicyv1Module.v1.SystemPolicyV1Client.apiEndpoint; + assert(apiEndpoint); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has port', () => { + const port = systempolicyv1Module.v1.SystemPolicyV1Client.port; + assert(port); + assert(typeof port === 'number'); }); - assert.strictEqual(client.systemPolicyV1Stub, undefined); - await client.initialize(); - assert(client.systemPolicyV1Stub); - }); - it('has close method for the initialized client', done => { - const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new systempolicyv1Module.v1.SystemPolicyV1Client(); + assert(client); }); - client.initialize(); - assert(client.systemPolicyV1Stub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ + fallback: true, + }); + assert(client); }); - }); - it('has close method for the non-initialized client', done => { - const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has initialize method and supports deferred initialization', async () => { + const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.systemPolicyV1Stub, undefined); + await client.initialize(); + assert(client.systemPolicyV1Stub); }); - assert.strictEqual(client.systemPolicyV1Stub, undefined); - client.close().then(() => { - done(); + + it('has close method for the initialized client', done => { + const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.systemPolicyV1Stub); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.systemPolicyV1Stub, 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 systempolicyv1Module.v1.SystemPolicyV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ + 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 systempolicyv1Module.v1.SystemPolicyV1Client({ + 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('getSystemPolicy', () => { diff --git a/packages/google-cloud-binaryauthorization/test/gapic_validation_helper_v1_v1.ts b/packages/google-cloud-binaryauthorization/test/gapic_validation_helper_v1_v1.ts index b085600f137..8b19183b8ab 100644 --- a/packages/google-cloud-binaryauthorization/test/gapic_validation_helper_v1_v1.ts +++ b/packages/google-cloud-binaryauthorization/test/gapic_validation_helper_v1_v1.ts @@ -50,101 +50,103 @@ function stubSimpleCallWithCallback( } describe('v1.ValidationHelperV1Client', () => { - it('has servicePath', () => { - const servicePath = - validationhelperv1Module.v1.ValidationHelperV1Client.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - validationhelperv1Module.v1.ValidationHelperV1Client.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = validationhelperv1Module.v1.ValidationHelperV1Client.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new validationhelperv1Module.v1.ValidationHelperV1Client(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + validationhelperv1Module.v1.ValidationHelperV1Client.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = + validationhelperv1Module.v1.ValidationHelperV1Client.apiEndpoint; + assert(apiEndpoint); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has port', () => { + const port = validationhelperv1Module.v1.ValidationHelperV1Client.port; + assert(port); + assert(typeof port === 'number'); }); - assert.strictEqual(client.validationHelperV1Stub, undefined); - await client.initialize(); - assert(client.validationHelperV1Stub); - }); - it('has close method for the initialized client', done => { - const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new validationhelperv1Module.v1.ValidationHelperV1Client(); + assert(client); }); - client.initialize(); - assert(client.validationHelperV1Stub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ + fallback: true, + }); + assert(client); }); - }); - it('has close method for the non-initialized client', done => { - const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has initialize method and supports deferred initialization', async () => { + const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.validationHelperV1Stub, undefined); + await client.initialize(); + assert(client.validationHelperV1Stub); }); - assert.strictEqual(client.validationHelperV1Stub, undefined); - client.close().then(() => { - done(); + + it('has close method for the initialized client', done => { + const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.validationHelperV1Stub); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.validationHelperV1Stub, 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 validationhelperv1Module.v1.ValidationHelperV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ + 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 validationhelperv1Module.v1.ValidationHelperV1Client({ + 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('validateAttestationOccurrence', () => {