diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 4d7eee28855..b4becef0b67 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -3934,19 +3934,19 @@ export namespace google { public selector: string; /** HttpRule get. */ - public get: string; + public get?: (string|null); /** HttpRule put. */ - public put: string; + public put?: (string|null); /** HttpRule post. */ - public post: string; + public post?: (string|null); /** HttpRule delete. */ - public delete: string; + public delete?: (string|null); /** HttpRule patch. */ - public patch: string; + public patch?: (string|null); /** HttpRule custom. */ public custom?: (google.api.ICustomHttpPattern|null); diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 63136e19eb5..85a4d4c9cf9 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -9155,43 +9155,43 @@ /** * HttpRule get. - * @member {string} get + * @member {string|null|undefined} get * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.get = ""; + HttpRule.prototype.get = null; /** * HttpRule put. - * @member {string} put + * @member {string|null|undefined} put * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.put = ""; + HttpRule.prototype.put = null; /** * HttpRule post. - * @member {string} post + * @member {string|null|undefined} post * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.post = ""; + HttpRule.prototype.post = null; /** * HttpRule delete. - * @member {string} delete + * @member {string|null|undefined} delete * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype["delete"] = ""; + HttpRule.prototype["delete"] = null; /** * HttpRule patch. - * @member {string} patch + * @member {string|null|undefined} patch * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.patch = ""; + HttpRule.prototype.patch = null; /** * HttpRule custom. diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index f2f7e09b04d..b77fb281d0e 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -246,13 +246,14 @@ export class RecaptchaEnterpriseServiceClient { ]; for (const methodName of recaptchaEnterpriseServiceStubMethods) { const callPromise = this.recaptchaEnterpriseServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -417,11 +418,10 @@ export class RecaptchaEnterpriseServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createAssessment(request, options, callback); } @@ -519,11 +519,10 @@ export class RecaptchaEnterpriseServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.annotateAssessment(request, options, callback); } @@ -614,11 +613,10 @@ export class RecaptchaEnterpriseServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createKey(request, options, callback); } @@ -707,11 +705,10 @@ export class RecaptchaEnterpriseServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getKey(request, options, callback); } @@ -802,11 +799,10 @@ export class RecaptchaEnterpriseServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'key.name': request.key!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'key.name': request.key!.name || '', + }); this.initialize(); return this.innerApiCalls.updateKey(request, options, callback); } @@ -895,11 +891,10 @@ export class RecaptchaEnterpriseServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteKey(request, options, callback); } @@ -998,11 +993,10 @@ export class RecaptchaEnterpriseServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listKeys(request, options, callback); } @@ -1040,11 +1034,10 @@ export class RecaptchaEnterpriseServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listKeys.createStream( @@ -1093,17 +1086,16 @@ export class RecaptchaEnterpriseServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listKeys.asyncIterate( this.innerApiCalls['listKeys'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 6797fd4037f..38fe9793c6e 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -246,13 +246,14 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ]; for (const methodName of recaptchaEnterpriseServiceV1Beta1StubMethods) { const callPromise = this.recaptchaEnterpriseServiceV1Beta1Stub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -417,11 +418,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createAssessment(request, options, callback); } @@ -519,11 +519,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.annotateAssessment(request, options, callback); } @@ -620,11 +619,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createKey(request, options, callback); } @@ -719,11 +717,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getKey(request, options, callback); } @@ -820,11 +817,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'key.name': request.key!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'key.name': request.key!.name || '', + }); this.initialize(); return this.innerApiCalls.updateKey(request, options, callback); } @@ -919,11 +915,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteKey(request, options, callback); } @@ -1022,11 +1017,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listKeys(request, options, callback); } @@ -1064,11 +1058,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listKeys.createStream( @@ -1117,17 +1110,16 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listKeys.asyncIterate( this.innerApiCalls['listKeys'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js index b5aead0cc2c..d686cde343d 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js @@ -20,7 +20,8 @@ const recaptchaenterprise = require('@google-cloud/recaptcha-enterprise'); function main() { - const recaptchaEnterpriseServiceClient = new recaptchaenterprise.RecaptchaEnterpriseServiceClient(); + const recaptchaEnterpriseServiceClient = + new recaptchaenterprise.RecaptchaEnterpriseServiceClient(); } main(); diff --git a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts index c90f525efe6..ad545b0d6fc 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts @@ -27,7 +27,8 @@ function doStuffWithRecaptchaEnterpriseServiceClient( function main() { // check that the client instance can be created - const recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + const recaptchaEnterpriseServiceClient = + new RecaptchaEnterpriseServiceClient(); doStuffWithRecaptchaEnterpriseServiceClient(recaptchaEnterpriseServiceClient); } diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index 6cf3b169775..634f3810699 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -136,49 +135,46 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('should create a client with no option', () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ fallback: true, - } - ); + }); assert(client); }); it('has initialize method and supports deferred initialization', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); assert.strictEqual(client.recaptchaEnterpriseServiceStub, undefined); await client.initialize(); assert(client.recaptchaEnterpriseServiceStub); }); it('has close method', () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.close(); }); it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ 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); @@ -187,12 +183,11 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -211,12 +206,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { describe('createAssessment', () => { it('invokes createAssessment without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() @@ -244,12 +240,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes createAssessment without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() @@ -266,9 +263,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Assessment() ); - client.innerApiCalls.createAssessment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createAssessment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createAssessment( request, @@ -294,12 +290,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes createAssessment with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() @@ -329,12 +326,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { describe('annotateAssessment', () => { it('invokes annotateAssessment without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() @@ -351,9 +349,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse() ); - client.innerApiCalls.annotateAssessment = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.annotateAssessment = + stubSimpleCall(expectedResponse); const [response] = await client.annotateAssessment(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -364,12 +361,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes annotateAssessment without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() @@ -386,9 +384,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse() ); - client.innerApiCalls.annotateAssessment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.annotateAssessment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.annotateAssessment( request, @@ -414,12 +411,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes annotateAssessment with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() @@ -449,12 +447,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { describe('createKey', () => { it('invokes createKey without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() @@ -482,12 +481,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes createKey without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() @@ -504,9 +504,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() ); - client.innerApiCalls.createKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createKey( request, @@ -532,12 +531,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes createKey with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() @@ -564,12 +564,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { describe('getKey', () => { it('invokes getKey without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() @@ -597,12 +598,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes getKey without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() @@ -619,9 +621,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() ); - client.innerApiCalls.getKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getKey( request, @@ -647,12 +648,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes getKey with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() @@ -679,12 +681,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { describe('updateKey', () => { it('invokes updateKey without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() @@ -713,12 +716,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes updateKey without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() @@ -736,9 +740,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() ); - client.innerApiCalls.updateKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateKey( request, @@ -764,12 +767,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes updateKey with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() @@ -797,12 +801,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { describe('deleteKey', () => { it('invokes deleteKey without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() @@ -830,12 +835,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes deleteKey without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() @@ -852,9 +858,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteKey( request, @@ -880,12 +885,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes deleteKey with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() @@ -912,12 +918,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { describe('listKeys', () => { it('invokes listKeys without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() @@ -953,12 +960,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes listKeys without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() @@ -983,9 +991,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.Key() ), ]; - client.innerApiCalls.listKeys = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listKeys = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listKeys( request, @@ -1011,12 +1018,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes listKeys with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() @@ -1041,12 +1049,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes listKeysStream without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() @@ -1064,9 +1073,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.Key() ), ]; - client.descriptors.page.listKeys.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listKeys.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listKeysStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.recaptchaenterprise.v1.Key[] = []; @@ -1098,12 +1106,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes listKeysStream with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() @@ -1145,12 +1154,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('uses async iteration with listKeys without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() @@ -1168,9 +1178,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.Key() ), ]; - client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listKeys.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.recaptchaenterprise.v1.IKey[] = []; const iterable = client.listKeysAsync(request); for await (const resource of iterable) { @@ -1190,12 +1199,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('uses async iteration with listKeys with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() @@ -1234,12 +1244,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { project: 'projectValue', assessment: 'assessmentValue', }; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.assessmentPathTemplate.render = sinon .stub() @@ -1285,12 +1296,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { project: 'projectValue', key: 'keyValue', }; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.keyPathTemplate.render = sinon .stub() @@ -1335,12 +1347,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const expectedParameters = { project: 'projectValue', }; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.projectPathTemplate.render = sinon .stub() diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts index e303dc1295d..c5c060f6c1c 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -137,49 +136,54 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('should create a client with no option', () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - fallback: true, - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + fallback: true, + } + ); assert(client); }); it('has initialize method and supports deferred initialization', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); assert.strictEqual(client.recaptchaEnterpriseServiceV1Beta1Stub, undefined); await client.initialize(); assert(client.recaptchaEnterpriseServiceV1Beta1Stub); }); it('has close method', () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.close(); }); it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + 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); @@ -188,12 +192,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -212,12 +217,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { describe('createAssessment', () => { it('invokes createAssessment without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() @@ -245,12 +251,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes createAssessment without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() @@ -267,9 +274,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.Assessment() ); - client.innerApiCalls.createAssessment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createAssessment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createAssessment( request, @@ -295,12 +301,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes createAssessment with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() @@ -330,12 +337,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { describe('annotateAssessment', () => { it('invokes annotateAssessment without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() @@ -352,9 +360,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse() ); - client.innerApiCalls.annotateAssessment = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.annotateAssessment = + stubSimpleCall(expectedResponse); const [response] = await client.annotateAssessment(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -365,12 +372,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes annotateAssessment without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() @@ -387,9 +395,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse() ); - client.innerApiCalls.annotateAssessment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.annotateAssessment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.annotateAssessment( request, @@ -415,12 +422,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes annotateAssessment with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() @@ -450,12 +458,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { describe('createKey', () => { it('invokes createKey without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() @@ -483,12 +492,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes createKey without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() @@ -505,9 +515,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.Key() ); - client.innerApiCalls.createKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createKey( request, @@ -533,12 +542,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes createKey with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() @@ -565,12 +575,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { describe('getKey', () => { it('invokes getKey without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() @@ -598,12 +609,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes getKey without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() @@ -620,9 +632,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.Key() ); - client.innerApiCalls.getKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getKey( request, @@ -648,12 +659,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes getKey with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() @@ -680,12 +692,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { describe('updateKey', () => { it('invokes updateKey without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() @@ -714,12 +727,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes updateKey without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() @@ -737,9 +751,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.Key() ); - client.innerApiCalls.updateKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateKey( request, @@ -765,12 +778,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes updateKey with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() @@ -798,12 +812,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { describe('deleteKey', () => { it('invokes deleteKey without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() @@ -831,12 +846,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes deleteKey without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() @@ -853,9 +869,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteKey( request, @@ -881,12 +896,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes deleteKey with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() @@ -913,12 +929,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { describe('listKeys', () => { it('invokes listKeys without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() @@ -954,12 +971,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes listKeys without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() @@ -984,9 +1002,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { new protos.google.cloud.recaptchaenterprise.v1beta1.Key() ), ]; - client.innerApiCalls.listKeys = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listKeys = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listKeys( request, @@ -1014,12 +1031,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes listKeys with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() @@ -1044,12 +1062,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes listKeysStream without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() @@ -1067,12 +1086,12 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { new protos.google.cloud.recaptchaenterprise.v1beta1.Key() ), ]; - client.descriptors.page.listKeys.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listKeys.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listKeysStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = []; + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = + []; stream.on( 'data', (response: protos.google.cloud.recaptchaenterprise.v1beta1.Key) => { @@ -1101,12 +1120,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes listKeysStream with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() @@ -1120,7 +1140,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); const stream = client.listKeysStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = []; + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = + []; stream.on( 'data', (response: protos.google.cloud.recaptchaenterprise.v1beta1.Key) => { @@ -1148,12 +1169,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('uses async iteration with listKeys without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() @@ -1171,10 +1193,10 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { new protos.google.cloud.recaptchaenterprise.v1beta1.Key() ), ]; - client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = []; + client.descriptors.page.listKeys.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = + []; const iterable = client.listKeysAsync(request); for await (const resource of iterable) { responses.push(resource!); @@ -1193,12 +1215,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('uses async iteration with listKeys with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() @@ -1212,7 +1235,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); const iterable = client.listKeysAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = []; + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = + []; for await (const resource of iterable) { responses.push(resource!); } @@ -1237,12 +1261,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { project: 'projectValue', assessment: 'assessmentValue', }; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.assessmentPathTemplate.render = sinon .stub() @@ -1288,12 +1313,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { project: 'projectValue', key: 'keyValue', }; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.keyPathTemplate.render = sinon .stub() @@ -1338,12 +1364,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const expectedParameters = { project: 'projectValue', }; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.projectPathTemplate.render = sinon .stub()