diff --git a/packages/google-cloud-texttospeech/samples/generated/v1/snippet_metadata.google.cloud.texttospeech.v1.json b/packages/google-cloud-texttospeech/samples/generated/v1/snippet_metadata.google.cloud.texttospeech.v1.json index 0a286884486..b4ecefc9134 100644 --- a/packages/google-cloud-texttospeech/samples/generated/v1/snippet_metadata.google.cloud.texttospeech.v1.json +++ b/packages/google-cloud-texttospeech/samples/generated/v1/snippet_metadata.google.cloud.texttospeech.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -62,7 +62,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 63, "type": "FULL" } ], diff --git a/packages/google-cloud-texttospeech/samples/generated/v1/text_to_speech.list_voices.js b/packages/google-cloud-texttospeech/samples/generated/v1/text_to_speech.list_voices.js index 54d474b895a..93e3359b3bc 100644 --- a/packages/google-cloud-texttospeech/samples/generated/v1/text_to_speech.list_voices.js +++ b/packages/google-cloud-texttospeech/samples/generated/v1/text_to_speech.list_voices.js @@ -23,6 +23,9 @@ function main() { // [START texttospeech_v1_generated_TextToSpeech_ListVoices_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-texttospeech/samples/generated/v1/text_to_speech.synthesize_speech.js b/packages/google-cloud-texttospeech/samples/generated/v1/text_to_speech.synthesize_speech.js index 5659d0e0a7e..e8a34543f95 100644 --- a/packages/google-cloud-texttospeech/samples/generated/v1/text_to_speech.synthesize_speech.js +++ b/packages/google-cloud-texttospeech/samples/generated/v1/text_to_speech.synthesize_speech.js @@ -23,6 +23,9 @@ function main(input, voice, audioConfig) { // [START texttospeech_v1_generated_TextToSpeech_SynthesizeSpeech_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-texttospeech/samples/generated/v1beta1/snippet_metadata.google.cloud.texttospeech.v1beta1.json b/packages/google-cloud-texttospeech/samples/generated/v1beta1/snippet_metadata.google.cloud.texttospeech.v1beta1.json index 747594f6358..ba9a9fc4af4 100644 --- a/packages/google-cloud-texttospeech/samples/generated/v1beta1/snippet_metadata.google.cloud.texttospeech.v1beta1.json +++ b/packages/google-cloud-texttospeech/samples/generated/v1beta1/snippet_metadata.google.cloud.texttospeech.v1beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -62,7 +62,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], diff --git a/packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech.list_voices.js b/packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech.list_voices.js index 698355f236e..3410c0eddfc 100644 --- a/packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech.list_voices.js +++ b/packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech.list_voices.js @@ -23,6 +23,9 @@ function main() { // [START texttospeech_v1beta1_generated_TextToSpeech_ListVoices_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-texttospeech/samples/generated/v1beta1/text_to_speech.synthesize_speech.js b/packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech.synthesize_speech.js index 8caaf86befb..5857dd63dde 100644 --- a/packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech.synthesize_speech.js +++ b/packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech.synthesize_speech.js @@ -23,6 +23,9 @@ function main(input, voice, audioConfig) { // [START texttospeech_v1beta1_generated_TextToSpeech_SynthesizeSpeech_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-texttospeech/src/v1/text_to_speech_client.ts b/packages/google-cloud-texttospeech/src/v1/text_to_speech_client.ts index dbd664ceb54..38d6e51fdff 100644 --- a/packages/google-cloud-texttospeech/src/v1/text_to_speech_client.ts +++ b/packages/google-cloud-texttospeech/src/v1/text_to_speech_client.ts @@ -228,7 +228,8 @@ export class TextToSpeechClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-texttospeech/src/v1beta1/text_to_speech_client.ts b/packages/google-cloud-texttospeech/src/v1beta1/text_to_speech_client.ts index 6e92206b0aa..fc824029f32 100644 --- a/packages/google-cloud-texttospeech/src/v1beta1/text_to_speech_client.ts +++ b/packages/google-cloud-texttospeech/src/v1beta1/text_to_speech_client.ts @@ -228,7 +228,8 @@ export class TextToSpeechClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-texttospeech/test/gapic_text_to_speech_v1.ts b/packages/google-cloud-texttospeech/test/gapic_text_to_speech_v1.ts index 3041b7b2fa7..4e913f3f233 100644 --- a/packages/google-cloud-texttospeech/test/gapic_text_to_speech_v1.ts +++ b/packages/google-cloud-texttospeech/test/gapic_text_to_speech_v1.ts @@ -50,99 +50,101 @@ function stubSimpleCallWithCallback( } describe('v1.TextToSpeechClient', () => { - it('has servicePath', () => { - const servicePath = texttospeechModule.v1.TextToSpeechClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = texttospeechModule.v1.TextToSpeechClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = texttospeechModule.v1.TextToSpeechClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new texttospeechModule.v1.TextToSpeechClient(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = texttospeechModule.v1.TextToSpeechClient.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new texttospeechModule.v1.TextToSpeechClient({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = texttospeechModule.v1.TextToSpeechClient.apiEndpoint; + assert(apiEndpoint); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new texttospeechModule.v1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has port', () => { + const port = texttospeechModule.v1.TextToSpeechClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert.strictEqual(client.textToSpeechStub, undefined); - await client.initialize(); - assert(client.textToSpeechStub); - }); - it('has close method for the initialized client', done => { - const client = new texttospeechModule.v1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new texttospeechModule.v1.TextToSpeechClient(); + assert(client); }); - client.initialize(); - assert(client.textToSpeechStub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new texttospeechModule.v1.TextToSpeechClient({ + fallback: true, + }); + assert(client); }); - }); - it('has close method for the non-initialized client', done => { - const client = new texttospeechModule.v1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has initialize method and supports deferred initialization', async () => { + const client = new texttospeechModule.v1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.textToSpeechStub, undefined); + await client.initialize(); + assert(client.textToSpeechStub); }); - assert.strictEqual(client.textToSpeechStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the initialized client', done => { + const client = new texttospeechModule.v1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.textToSpeechStub); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new texttospeechModule.v1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = new texttospeechModule.v1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.textToSpeechStub, 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 texttospeechModule.v1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new texttospeechModule.v1.TextToSpeechClient({ + 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 texttospeechModule.v1.TextToSpeechClient({ + 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('listVoices', () => { diff --git a/packages/google-cloud-texttospeech/test/gapic_text_to_speech_v1beta1.ts b/packages/google-cloud-texttospeech/test/gapic_text_to_speech_v1beta1.ts index 0c20d4b6398..8d4fab2d66b 100644 --- a/packages/google-cloud-texttospeech/test/gapic_text_to_speech_v1beta1.ts +++ b/packages/google-cloud-texttospeech/test/gapic_text_to_speech_v1beta1.ts @@ -50,101 +50,103 @@ function stubSimpleCallWithCallback( } describe('v1beta1.TextToSpeechClient', () => { - it('has servicePath', () => { - const servicePath = - texttospeechModule.v1beta1.TextToSpeechClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - texttospeechModule.v1beta1.TextToSpeechClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = texttospeechModule.v1beta1.TextToSpeechClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new texttospeechModule.v1beta1.TextToSpeechClient(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + texttospeechModule.v1beta1.TextToSpeechClient.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new texttospeechModule.v1beta1.TextToSpeechClient({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = + texttospeechModule.v1beta1.TextToSpeechClient.apiEndpoint; + assert(apiEndpoint); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new texttospeechModule.v1beta1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has port', () => { + const port = texttospeechModule.v1beta1.TextToSpeechClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert.strictEqual(client.textToSpeechStub, undefined); - await client.initialize(); - assert(client.textToSpeechStub); - }); - it('has close method for the initialized client', done => { - const client = new texttospeechModule.v1beta1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new texttospeechModule.v1beta1.TextToSpeechClient(); + assert(client); }); - client.initialize(); - assert(client.textToSpeechStub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new texttospeechModule.v1beta1.TextToSpeechClient({ + fallback: true, + }); + assert(client); }); - }); - it('has close method for the non-initialized client', done => { - const client = new texttospeechModule.v1beta1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has initialize method and supports deferred initialization', async () => { + const client = new texttospeechModule.v1beta1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.textToSpeechStub, undefined); + await client.initialize(); + assert(client.textToSpeechStub); }); - assert.strictEqual(client.textToSpeechStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the initialized client', done => { + const client = new texttospeechModule.v1beta1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.textToSpeechStub); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new texttospeechModule.v1beta1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = new texttospeechModule.v1beta1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.textToSpeechStub, 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 texttospeechModule.v1beta1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new texttospeechModule.v1beta1.TextToSpeechClient({ + 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 texttospeechModule.v1beta1.TextToSpeechClient({ + 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('listVoices', () => {