diff --git a/samples/generated/v1/essential_contacts_service.compute_contacts.js b/samples/generated/v1/essential_contacts_service.compute_contacts.js index 00d490a..40dacdb 100644 --- a/samples/generated/v1/essential_contacts_service.compute_contacts.js +++ b/samples/generated/v1/essential_contacts_service.compute_contacts.js @@ -23,6 +23,9 @@ function main(parent) { // [START essentialcontacts_v1_generated_EssentialContactsService_ComputeContacts_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1/essential_contacts_service.create_contact.js b/samples/generated/v1/essential_contacts_service.create_contact.js index f1fd31c..a087e10 100644 --- a/samples/generated/v1/essential_contacts_service.create_contact.js +++ b/samples/generated/v1/essential_contacts_service.create_contact.js @@ -23,6 +23,9 @@ function main(parent, contact) { // [START essentialcontacts_v1_generated_EssentialContactsService_CreateContact_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1/essential_contacts_service.delete_contact.js b/samples/generated/v1/essential_contacts_service.delete_contact.js index 3d046c6..6f5d017 100644 --- a/samples/generated/v1/essential_contacts_service.delete_contact.js +++ b/samples/generated/v1/essential_contacts_service.delete_contact.js @@ -23,6 +23,9 @@ function main(name) { // [START essentialcontacts_v1_generated_EssentialContactsService_DeleteContact_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1/essential_contacts_service.get_contact.js b/samples/generated/v1/essential_contacts_service.get_contact.js index 7251622..c62013a 100644 --- a/samples/generated/v1/essential_contacts_service.get_contact.js +++ b/samples/generated/v1/essential_contacts_service.get_contact.js @@ -23,6 +23,9 @@ function main(name) { // [START essentialcontacts_v1_generated_EssentialContactsService_GetContact_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1/essential_contacts_service.list_contacts.js b/samples/generated/v1/essential_contacts_service.list_contacts.js index 2c6469d..ed35bd7 100644 --- a/samples/generated/v1/essential_contacts_service.list_contacts.js +++ b/samples/generated/v1/essential_contacts_service.list_contacts.js @@ -23,6 +23,9 @@ function main(parent) { // [START essentialcontacts_v1_generated_EssentialContactsService_ListContacts_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1/essential_contacts_service.send_test_message.js b/samples/generated/v1/essential_contacts_service.send_test_message.js index 122460f..64e2c8d 100644 --- a/samples/generated/v1/essential_contacts_service.send_test_message.js +++ b/samples/generated/v1/essential_contacts_service.send_test_message.js @@ -23,6 +23,9 @@ function main(contacts, resource, notificationCategory) { // [START essentialcontacts_v1_generated_EssentialContactsService_SendTestMessage_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1/essential_contacts_service.update_contact.js b/samples/generated/v1/essential_contacts_service.update_contact.js index c81be34..92ad817 100644 --- a/samples/generated/v1/essential_contacts_service.update_contact.js +++ b/samples/generated/v1/essential_contacts_service.update_contact.js @@ -23,6 +23,9 @@ function main(contact) { // [START essentialcontacts_v1_generated_EssentialContactsService_UpdateContact_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json b/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json index 8b33462..9613365 100644 --- a/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json +++ b/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 61, "type": "FULL" } ], @@ -66,7 +66,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], @@ -110,7 +110,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], @@ -158,7 +158,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -198,7 +198,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -238,7 +238,7 @@ "segments": [ { "start": 25, - "end": 74, + "end": 77, "type": "FULL" } ], @@ -290,7 +290,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], diff --git a/src/v1/essential_contacts_service_client.ts b/src/v1/essential_contacts_service_client.ts index 6a1b1b7..3ee4db1 100644 --- a/src/v1/essential_contacts_service_client.ts +++ b/src/v1/essential_contacts_service_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'); /** @@ -272,7 +271,8 @@ export class EssentialContactsServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -997,7 +997,7 @@ export class EssentialContactsServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listContacts.createStream( - this.innerApiCalls.listContacts as gax.GaxCall, + this.innerApiCalls.listContacts as GaxCall, request, callSettings ); @@ -1053,7 +1053,7 @@ export class EssentialContactsServiceClient { this.initialize(); return this.descriptors.page.listContacts.asyncIterate( this.innerApiCalls['listContacts'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -1220,7 +1220,7 @@ export class EssentialContactsServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.computeContacts.createStream( - this.innerApiCalls.computeContacts as gax.GaxCall, + this.innerApiCalls.computeContacts as GaxCall, request, callSettings ); @@ -1280,7 +1280,7 @@ export class EssentialContactsServiceClient { this.initialize(); return this.descriptors.page.computeContacts.asyncIterate( this.innerApiCalls['computeContacts'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/test/gapic_essential_contacts_service_v1.ts b/test/gapic_essential_contacts_service_v1.ts index 1b3d957..07484d8 100644 --- a/test/gapic_essential_contacts_service_v1.ts +++ b/test/gapic_essential_contacts_service_v1.ts @@ -113,111 +113,113 @@ function stubAsyncIterationCall( } describe('v1.EssentialContactsServiceClient', () => { - it('has servicePath', () => { - const servicePath = - essentialcontactsserviceModule.v1.EssentialContactsServiceClient - .servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + essentialcontactsserviceModule.v1.EssentialContactsServiceClient + .servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - essentialcontactsserviceModule.v1.EssentialContactsServiceClient - .apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + essentialcontactsserviceModule.v1.EssentialContactsServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - essentialcontactsserviceModule.v1.EssentialContactsServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + essentialcontactsserviceModule.v1.EssentialContactsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new essentialcontactsserviceModule.v1.EssentialContactsServiceClient(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ - fallback: true, - }); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + fallback: true, + }); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.essentialContactsServiceStub, undefined); - await client.initialize(); - assert(client.essentialContactsServiceStub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.essentialContactsServiceStub, undefined); + await client.initialize(); + assert(client.essentialContactsServiceStub); + }); - it('has close method for the initialized client', done => { - const client = - new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.essentialContactsServiceStub); + client.close().then(() => { + done(); }); - client.initialize(); - assert(client.essentialContactsServiceStub); - client.close().then(() => { - done(); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.essentialContactsServiceStub, undefined); + client.close().then(() => { + done(); }); - assert.strictEqual(client.essentialContactsServiceStub, undefined); - client.close().then(() => { - done(); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ - 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 essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + 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 essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ - 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 essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + 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('createContact', () => {