From bb723f12bbdfcbfba9311d36b78704e9bbfbe758 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Mon, 16 Sep 2019 13:36:32 +0100 Subject: [PATCH] Generate TextToSpeech and delete old generated code (We now generate with .g.cs instead of .cs) Results of compatibility checker: ```text Major changes: Class 'Google.Cloud.TextToSpeech.V1.TextToSpeechClientBuilder' removed. Class 'Google.Cloud.TextToSpeech.V1.TextToSpeechSettings'; method 'Google.Api.Gax.Grpc.BackoffSettings GetDefaultRetryBackoff()' removed. Class 'Google.Cloud.TextToSpeech.V1.TextToSpeechSettings'; method 'Google.Api.Gax.Grpc.BackoffSettings GetDefaultTimeoutBackoff()' removed. Class 'Google.Cloud.TextToSpeech.V1.TextToSpeechSettings'; property 'System.Predicate IdempotentRetryFilter { get; }' removed. Class 'Google.Cloud.TextToSpeech.V1.TextToSpeechSettings'; property 'System.Predicate NonIdempotentRetryFilter { get; }' removed. Diff level: Major ``` --- .../TextToSpeechClientSnippets.g.cs | 117 ++- .../TextToSpeechClientTest.g.cs | 200 ++--- .../TextToSpeechClient.cs | 813 ------------------ .../TextToSpeechClient.g.cs | 516 +++++++++++ 4 files changed, 669 insertions(+), 977 deletions(-) delete mode 100644 apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1/TextToSpeechClient.cs create mode 100644 apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1/TextToSpeechClient.g.cs diff --git a/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1.Snippets/TextToSpeechClientSnippets.g.cs b/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1.Snippets/TextToSpeechClientSnippets.g.cs index d2e78c64d6ae..62396387fdcc 100644 --- a/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1.Snippets/TextToSpeechClientSnippets.g.cs +++ b/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1.Snippets/TextToSpeechClientSnippets.g.cs @@ -14,115 +14,90 @@ // Generated code. DO NOT EDIT! -namespace Google.Cloud.TextToSpeech.V1.Snippets +namespace Google.Cloud.TextToSpeech.V1 { - using Google.Api.Gax; - using Google.Api.Gax.Grpc; - using apis = Google.Cloud.TextToSpeech.V1; - using Google.Protobuf; - using Google.Protobuf.WellKnownTypes; - using Grpc.Core; - using System; - using System.Collections; - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.Linq; - using System.Threading; using System.Threading.Tasks; - /// Generated snippets - public class GeneratedTextToSpeechClientSnippets + /// Generated snippets. + public sealed class GeneratedTextToSpeechSnippets { - /// Snippet for ListVoicesAsync - public async Task ListVoicesAsync() - { - // Snippet: ListVoicesAsync(string,CallSettings) - // Additional: ListVoicesAsync(string,CancellationToken) - // Create client - TextToSpeechClient textToSpeechClient = await TextToSpeechClient.CreateAsync(); - // Initialize request argument(s) - string languageCode = ""; - // Make the request - ListVoicesResponse response = await textToSpeechClient.ListVoicesAsync(languageCode); - // End snippet - } - /// Snippet for ListVoices - public void ListVoices() + public void ListVoices_RequestObject() { - // Snippet: ListVoices(string,CallSettings) + // Snippet: ListVoices(ListVoicesRequest, CallSettings) // Create client TextToSpeechClient textToSpeechClient = TextToSpeechClient.Create(); // Initialize request argument(s) - string languageCode = ""; + ListVoicesRequest request = new ListVoicesRequest { LanguageCode = "", }; // Make the request - ListVoicesResponse response = textToSpeechClient.ListVoices(languageCode); + ListVoicesResponse response = textToSpeechClient.ListVoices(request); // End snippet } /// Snippet for ListVoicesAsync public async Task ListVoicesAsync_RequestObject() { - // Snippet: ListVoicesAsync(ListVoicesRequest,CallSettings) - // Additional: ListVoicesAsync(ListVoicesRequest,CancellationToken) + // Snippet: ListVoicesAsync(ListVoicesRequest, CallSettings) + // Additional: ListVoicesAsync(ListVoicesRequest, CancellationToken) // Create client TextToSpeechClient textToSpeechClient = await TextToSpeechClient.CreateAsync(); // Initialize request argument(s) - ListVoicesRequest request = new ListVoicesRequest(); + ListVoicesRequest request = new ListVoicesRequest { LanguageCode = "", }; // Make the request ListVoicesResponse response = await textToSpeechClient.ListVoicesAsync(request); // End snippet } /// Snippet for ListVoices - public void ListVoices_RequestObject() + public void ListVoices() { - // Snippet: ListVoices(ListVoicesRequest,CallSettings) + // Snippet: ListVoices(String, CallSettings) // Create client TextToSpeechClient textToSpeechClient = TextToSpeechClient.Create(); // Initialize request argument(s) - ListVoicesRequest request = new ListVoicesRequest(); + string languageCode = ""; // Make the request - ListVoicesResponse response = textToSpeechClient.ListVoices(request); + ListVoicesResponse response = textToSpeechClient.ListVoices(languageCode); // End snippet } - /// Snippet for SynthesizeSpeechAsync - public async Task SynthesizeSpeechAsync() + /// Snippet for ListVoicesAsync + public async Task ListVoicesAsync() { - // Snippet: SynthesizeSpeechAsync(SynthesisInput,VoiceSelectionParams,AudioConfig,CallSettings) - // Additional: SynthesizeSpeechAsync(SynthesisInput,VoiceSelectionParams,AudioConfig,CancellationToken) + // Snippet: ListVoicesAsync(String, CallSettings) + // Additional: ListVoicesAsync(String, CancellationToken) // Create client TextToSpeechClient textToSpeechClient = await TextToSpeechClient.CreateAsync(); // Initialize request argument(s) - SynthesisInput input = new SynthesisInput(); - VoiceSelectionParams voice = new VoiceSelectionParams(); - AudioConfig audioConfig = new AudioConfig(); + string languageCode = ""; // Make the request - SynthesizeSpeechResponse response = await textToSpeechClient.SynthesizeSpeechAsync(input, voice, audioConfig); + ListVoicesResponse response = await textToSpeechClient.ListVoicesAsync(languageCode); // End snippet } /// Snippet for SynthesizeSpeech - public void SynthesizeSpeech() + public void SynthesizeSpeech_RequestObject() { - // Snippet: SynthesizeSpeech(SynthesisInput,VoiceSelectionParams,AudioConfig,CallSettings) + // Snippet: SynthesizeSpeech(SynthesizeSpeechRequest, CallSettings) // Create client TextToSpeechClient textToSpeechClient = TextToSpeechClient.Create(); // Initialize request argument(s) - SynthesisInput input = new SynthesisInput(); - VoiceSelectionParams voice = new VoiceSelectionParams(); - AudioConfig audioConfig = new AudioConfig(); + SynthesizeSpeechRequest request = new SynthesizeSpeechRequest + { + Input = new SynthesisInput(), + Voice = new VoiceSelectionParams(), + AudioConfig = new AudioConfig(), + }; // Make the request - SynthesizeSpeechResponse response = textToSpeechClient.SynthesizeSpeech(input, voice, audioConfig); + SynthesizeSpeechResponse response = textToSpeechClient.SynthesizeSpeech(request); // End snippet } /// Snippet for SynthesizeSpeechAsync public async Task SynthesizeSpeechAsync_RequestObject() { - // Snippet: SynthesizeSpeechAsync(SynthesizeSpeechRequest,CallSettings) - // Additional: SynthesizeSpeechAsync(SynthesizeSpeechRequest,CancellationToken) + // Snippet: SynthesizeSpeechAsync(SynthesizeSpeechRequest, CallSettings) + // Additional: SynthesizeSpeechAsync(SynthesizeSpeechRequest, CancellationToken) // Create client TextToSpeechClient textToSpeechClient = await TextToSpeechClient.CreateAsync(); // Initialize request argument(s) @@ -138,22 +113,34 @@ public async Task SynthesizeSpeechAsync_RequestObject() } /// Snippet for SynthesizeSpeech - public void SynthesizeSpeech_RequestObject() + public void SynthesizeSpeech() { - // Snippet: SynthesizeSpeech(SynthesizeSpeechRequest,CallSettings) + // Snippet: SynthesizeSpeech(SynthesisInput, VoiceSelectionParams, AudioConfig, CallSettings) // Create client TextToSpeechClient textToSpeechClient = TextToSpeechClient.Create(); // Initialize request argument(s) - SynthesizeSpeechRequest request = new SynthesizeSpeechRequest - { - Input = new SynthesisInput(), - Voice = new VoiceSelectionParams(), - AudioConfig = new AudioConfig(), - }; + SynthesisInput input = new SynthesisInput(); + VoiceSelectionParams voice = new VoiceSelectionParams(); + AudioConfig audioConfig = new AudioConfig(); // Make the request - SynthesizeSpeechResponse response = textToSpeechClient.SynthesizeSpeech(request); + SynthesizeSpeechResponse response = textToSpeechClient.SynthesizeSpeech(input, voice, audioConfig); // End snippet } + /// Snippet for SynthesizeSpeechAsync + public async Task SynthesizeSpeechAsync() + { + // Snippet: SynthesizeSpeechAsync(SynthesisInput, VoiceSelectionParams, AudioConfig, CallSettings) + // Additional: SynthesizeSpeechAsync(SynthesisInput, VoiceSelectionParams, AudioConfig, CancellationToken) + // Create client + TextToSpeechClient textToSpeechClient = await TextToSpeechClient.CreateAsync(); + // Initialize request argument(s) + SynthesisInput input = new SynthesisInput(); + VoiceSelectionParams voice = new VoiceSelectionParams(); + AudioConfig audioConfig = new AudioConfig(); + // Make the request + SynthesizeSpeechResponse response = await textToSpeechClient.SynthesizeSpeechAsync(input, voice, audioConfig); + // End snippet + } } } diff --git a/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1.Tests/TextToSpeechClientTest.g.cs b/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1.Tests/TextToSpeechClientTest.g.cs index 4e8e5d05f4fb..58c81db67714 100644 --- a/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1.Tests/TextToSpeechClientTest.g.cs +++ b/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1.Tests/TextToSpeechClientTest.g.cs @@ -14,95 +14,104 @@ // Generated code. DO NOT EDIT! -namespace Google.Cloud.TextToSpeech.V1.Tests -{ - using Google.Api.Gax; - using Google.Api.Gax.Grpc; - using apis = Google.Cloud.TextToSpeech.V1; - using Google.Protobuf; - using Google.Protobuf.WellKnownTypes; - using Grpc.Core; - using Moq; - using System; - using System.Collections; - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.Threading; - using System.Threading.Tasks; - using Xunit; +using gaxgrpc = Google.Api.Gax.Grpc; +using proto = Google.Protobuf; +using grpccore = Grpc.Core; +using moq = Moq; +using st = System.Threading; +using stt = System.Threading.Tasks; +using xunit = Xunit; - /// Generated unit tests - public class GeneratedTextToSpeechClientTest +namespace Google.Cloud.TextToSpeech.V1 +{ + /// Generated unit tests. + public sealed class GeneratedTextToSpeechTest { - [Fact] - public void ListVoices() + [xunit::FactAttribute] + public void ListVoicesRequestObject() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - ListVoicesRequest expectedRequest = new ListVoicesRequest + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + ListVoicesRequest request = new ListVoicesRequest { - LanguageCode = "languageCode-412800396", + LanguageCode = "language_code2f6c7160", }; - ListVoicesResponse expectedResponse = new ListVoicesResponse(); - mockGrpcClient.Setup(x => x.ListVoices(expectedRequest, It.IsAny())) - .Returns(expectedResponse); + ListVoicesResponse expectedResponse = new ListVoicesResponse + { + Voices = { new Voice(), }, + }; + mockGrpcClient.Setup(x => x.ListVoices(request, moq::It.IsAny())).Returns(expectedResponse); TextToSpeechClient client = new TextToSpeechClientImpl(mockGrpcClient.Object, null); - string languageCode = "languageCode-412800396"; - ListVoicesResponse response = client.ListVoices(languageCode); - Assert.Same(expectedResponse, response); + ListVoicesResponse response = client.ListVoices(request); + xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } - [Fact] - public async Task ListVoicesAsync() + [xunit::FactAttribute] + public async stt::Task ListVoicesRequestObjectAsync() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - ListVoicesRequest expectedRequest = new ListVoicesRequest + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + ListVoicesRequest request = new ListVoicesRequest { - LanguageCode = "languageCode-412800396", + LanguageCode = "language_code2f6c7160", }; - ListVoicesResponse expectedResponse = new ListVoicesResponse(); - mockGrpcClient.Setup(x => x.ListVoicesAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + ListVoicesResponse expectedResponse = new ListVoicesResponse + { + Voices = { new Voice(), }, + }; + mockGrpcClient.Setup(x => x.ListVoicesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); TextToSpeechClient client = new TextToSpeechClientImpl(mockGrpcClient.Object, null); - string languageCode = "languageCode-412800396"; - ListVoicesResponse response = await client.ListVoicesAsync(languageCode); - Assert.Same(expectedResponse, response); + ListVoicesResponse responseCallSettings = await client.ListVoicesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + xunit::Assert.Same(expectedResponse, responseCallSettings); + ListVoicesResponse responseCancellationToken = await client.ListVoicesAsync(request, st::CancellationToken.None); + xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - [Fact] - public void ListVoices2() + [xunit::FactAttribute] + public void ListVoices() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - ListVoicesRequest request = new ListVoicesRequest(); - ListVoicesResponse expectedResponse = new ListVoicesResponse(); - mockGrpcClient.Setup(x => x.ListVoices(request, It.IsAny())) - .Returns(expectedResponse); + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + ListVoicesRequest request = new ListVoicesRequest + { + LanguageCode = "language_code2f6c7160", + }; + ListVoicesResponse expectedResponse = new ListVoicesResponse + { + Voices = { new Voice(), }, + }; + mockGrpcClient.Setup(x => x.ListVoices(request, moq::It.IsAny())).Returns(expectedResponse); TextToSpeechClient client = new TextToSpeechClientImpl(mockGrpcClient.Object, null); - ListVoicesResponse response = client.ListVoices(request); - Assert.Same(expectedResponse, response); + ListVoicesResponse response = client.ListVoices(request.LanguageCode); + xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } - [Fact] - public async Task ListVoicesAsync2() + [xunit::FactAttribute] + public async stt::Task ListVoicesAsync() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - ListVoicesRequest request = new ListVoicesRequest(); - ListVoicesResponse expectedResponse = new ListVoicesResponse(); - mockGrpcClient.Setup(x => x.ListVoicesAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + ListVoicesRequest request = new ListVoicesRequest + { + LanguageCode = "language_code2f6c7160", + }; + ListVoicesResponse expectedResponse = new ListVoicesResponse + { + Voices = { new Voice(), }, + }; + mockGrpcClient.Setup(x => x.ListVoicesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); TextToSpeechClient client = new TextToSpeechClientImpl(mockGrpcClient.Object, null); - ListVoicesResponse response = await client.ListVoicesAsync(request); - Assert.Same(expectedResponse, response); + ListVoicesResponse responseCallSettings = await client.ListVoicesAsync(request.LanguageCode, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + xunit::Assert.Same(expectedResponse, responseCallSettings); + ListVoicesResponse responseCancellationToken = await client.ListVoicesAsync(request.LanguageCode, st::CancellationToken.None); + xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - [Fact] - public void SynthesizeSpeech() + [xunit::FactAttribute] + public void SynthesizeSpeechRequestObject() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - SynthesizeSpeechRequest expectedRequest = new SynthesizeSpeechRequest + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + SynthesizeSpeechRequest request = new SynthesizeSpeechRequest { Input = new SynthesisInput(), Voice = new VoiceSelectionParams(), @@ -110,24 +119,20 @@ public void SynthesizeSpeech() }; SynthesizeSpeechResponse expectedResponse = new SynthesizeSpeechResponse { - AudioContent = ByteString.CopyFromUtf8("16"), + AudioContent = proto::ByteString.CopyFromUtf8("audio_content20992f23"), }; - mockGrpcClient.Setup(x => x.SynthesizeSpeech(expectedRequest, It.IsAny())) - .Returns(expectedResponse); + mockGrpcClient.Setup(x => x.SynthesizeSpeech(request, moq::It.IsAny())).Returns(expectedResponse); TextToSpeechClient client = new TextToSpeechClientImpl(mockGrpcClient.Object, null); - SynthesisInput input = new SynthesisInput(); - VoiceSelectionParams voice = new VoiceSelectionParams(); - AudioConfig audioConfig = new AudioConfig(); - SynthesizeSpeechResponse response = client.SynthesizeSpeech(input, voice, audioConfig); - Assert.Same(expectedResponse, response); + SynthesizeSpeechResponse response = client.SynthesizeSpeech(request); + xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } - [Fact] - public async Task SynthesizeSpeechAsync() + [xunit::FactAttribute] + public async stt::Task SynthesizeSpeechRequestObjectAsync() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); - SynthesizeSpeechRequest expectedRequest = new SynthesizeSpeechRequest + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + SynthesizeSpeechRequest request = new SynthesizeSpeechRequest { Input = new SynthesisInput(), Voice = new VoiceSelectionParams(), @@ -135,23 +140,21 @@ public async Task SynthesizeSpeechAsync() }; SynthesizeSpeechResponse expectedResponse = new SynthesizeSpeechResponse { - AudioContent = ByteString.CopyFromUtf8("16"), + AudioContent = proto::ByteString.CopyFromUtf8("audio_content20992f23"), }; - mockGrpcClient.Setup(x => x.SynthesizeSpeechAsync(expectedRequest, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.SynthesizeSpeechAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); TextToSpeechClient client = new TextToSpeechClientImpl(mockGrpcClient.Object, null); - SynthesisInput input = new SynthesisInput(); - VoiceSelectionParams voice = new VoiceSelectionParams(); - AudioConfig audioConfig = new AudioConfig(); - SynthesizeSpeechResponse response = await client.SynthesizeSpeechAsync(input, voice, audioConfig); - Assert.Same(expectedResponse, response); + SynthesizeSpeechResponse responseCallSettings = await client.SynthesizeSpeechAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + xunit::Assert.Same(expectedResponse, responseCallSettings); + SynthesizeSpeechResponse responseCancellationToken = await client.SynthesizeSpeechAsync(request, st::CancellationToken.None); + xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - [Fact] - public void SynthesizeSpeech2() + [xunit::FactAttribute] + public void SynthesizeSpeech() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); SynthesizeSpeechRequest request = new SynthesizeSpeechRequest { Input = new SynthesisInput(), @@ -160,20 +163,19 @@ public void SynthesizeSpeech2() }; SynthesizeSpeechResponse expectedResponse = new SynthesizeSpeechResponse { - AudioContent = ByteString.CopyFromUtf8("16"), + AudioContent = proto::ByteString.CopyFromUtf8("audio_content20992f23"), }; - mockGrpcClient.Setup(x => x.SynthesizeSpeech(request, It.IsAny())) - .Returns(expectedResponse); + mockGrpcClient.Setup(x => x.SynthesizeSpeech(request, moq::It.IsAny())).Returns(expectedResponse); TextToSpeechClient client = new TextToSpeechClientImpl(mockGrpcClient.Object, null); - SynthesizeSpeechResponse response = client.SynthesizeSpeech(request); - Assert.Same(expectedResponse, response); + SynthesizeSpeechResponse response = client.SynthesizeSpeech(request.Input, request.Voice, request.AudioConfig); + xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } - [Fact] - public async Task SynthesizeSpeechAsync2() + [xunit::FactAttribute] + public async stt::Task SynthesizeSpeechAsync() { - Mock mockGrpcClient = new Mock(MockBehavior.Strict); + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); SynthesizeSpeechRequest request = new SynthesizeSpeechRequest { Input = new SynthesisInput(), @@ -182,15 +184,15 @@ public async Task SynthesizeSpeechAsync2() }; SynthesizeSpeechResponse expectedResponse = new SynthesizeSpeechResponse { - AudioContent = ByteString.CopyFromUtf8("16"), + AudioContent = proto::ByteString.CopyFromUtf8("audio_content20992f23"), }; - mockGrpcClient.Setup(x => x.SynthesizeSpeechAsync(request, It.IsAny())) - .Returns(new Grpc.Core.AsyncUnaryCall(Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.SynthesizeSpeechAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); TextToSpeechClient client = new TextToSpeechClientImpl(mockGrpcClient.Object, null); - SynthesizeSpeechResponse response = await client.SynthesizeSpeechAsync(request); - Assert.Same(expectedResponse, response); + SynthesizeSpeechResponse responseCallSettings = await client.SynthesizeSpeechAsync(request.Input, request.Voice, request.AudioConfig, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + xunit::Assert.Same(expectedResponse, responseCallSettings); + SynthesizeSpeechResponse responseCancellationToken = await client.SynthesizeSpeechAsync(request.Input, request.Voice, request.AudioConfig, st::CancellationToken.None); + xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - } } diff --git a/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1/TextToSpeechClient.cs b/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1/TextToSpeechClient.cs deleted file mode 100644 index 80e020bed09d..000000000000 --- a/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1/TextToSpeechClient.cs +++ /dev/null @@ -1,813 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated code. DO NOT EDIT! - -using gax = Google.Api.Gax; -using gaxgrpc = Google.Api.Gax.Grpc; -using pb = Google.Protobuf; -using pbwkt = Google.Protobuf.WellKnownTypes; -using grpccore = Grpc.Core; -using sys = System; -using sc = System.Collections; -using scg = System.Collections.Generic; -using sco = System.Collections.ObjectModel; -using st = System.Threading; -using stt = System.Threading.Tasks; - -namespace Google.Cloud.TextToSpeech.V1 -{ - /// - /// Settings for a . - /// - public sealed partial class TextToSpeechSettings : gaxgrpc::ServiceSettingsBase - { - /// - /// Get a new instance of the default . - /// - /// - /// A new instance of the default . - /// - public static TextToSpeechSettings GetDefault() => new TextToSpeechSettings(); - - /// - /// Constructs a new object with default settings. - /// - public TextToSpeechSettings() { } - - private TextToSpeechSettings(TextToSpeechSettings existing) : base(existing) - { - gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); - ListVoicesSettings = existing.ListVoicesSettings; - SynthesizeSpeechSettings = existing.SynthesizeSpeechSettings; - OnCopy(existing); - } - - partial void OnCopy(TextToSpeechSettings existing); - - /// - /// The filter specifying which RPC s are eligible for retry - /// for "Idempotent" RPC methods. - /// - /// - /// The eligible RPC s for retry for "Idempotent" RPC methods are: - /// - /// - /// - /// - /// - public static sys::Predicate IdempotentRetryFilter { get; } = - gaxgrpc::RetrySettings.FilterForStatusCodes(grpccore::StatusCode.DeadlineExceeded, grpccore::StatusCode.Unavailable); - - /// - /// The filter specifying which RPC s are eligible for retry - /// for "NonIdempotent" RPC methods. - /// - /// - /// There are no RPC s eligible for retry for "NonIdempotent" RPC methods. - /// - public static sys::Predicate NonIdempotentRetryFilter { get; } = - gaxgrpc::RetrySettings.FilterForStatusCodes(); - - /// - /// "Default" retry backoff for RPC methods. - /// - /// - /// The "Default" retry backoff for RPC methods. - /// - /// - /// The "Default" retry backoff for RPC methods is defined as: - /// - /// Initial delay: 100 milliseconds - /// Maximum delay: 60000 milliseconds - /// Delay multiplier: 1.3 - /// - /// - public static gaxgrpc::BackoffSettings GetDefaultRetryBackoff() => new gaxgrpc::BackoffSettings( - delay: sys::TimeSpan.FromMilliseconds(100), - maxDelay: sys::TimeSpan.FromMilliseconds(60000), - delayMultiplier: 1.3 - ); - - /// - /// "Default" timeout backoff for RPC methods. - /// - /// - /// The "Default" timeout backoff for RPC methods. - /// - /// - /// The "Default" timeout backoff for RPC methods is defined as: - /// - /// Initial timeout: 20000 milliseconds - /// Timeout multiplier: 1.0 - /// Maximum timeout: 20000 milliseconds - /// - /// - public static gaxgrpc::BackoffSettings GetDefaultTimeoutBackoff() => new gaxgrpc::BackoffSettings( - delay: sys::TimeSpan.FromMilliseconds(20000), - maxDelay: sys::TimeSpan.FromMilliseconds(20000), - delayMultiplier: 1.0 - ); - - /// - /// for synchronous and asynchronous calls to - /// TextToSpeechClient.ListVoices and TextToSpeechClient.ListVoicesAsync. - /// - /// - /// The default TextToSpeechClient.ListVoices and - /// TextToSpeechClient.ListVoicesAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.3 - /// Retry maximum delay: 60000 milliseconds - /// Initial timeout: 20000 milliseconds - /// Timeout multiplier: 1.0 - /// Timeout maximum delay: 20000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// - /// - /// - /// Default RPC expiration is 600000 milliseconds. - /// - public gaxgrpc::CallSettings ListVoicesSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(600000)), - retryFilter: IdempotentRetryFilter - ))); - - /// - /// for synchronous and asynchronous calls to - /// TextToSpeechClient.SynthesizeSpeech and TextToSpeechClient.SynthesizeSpeechAsync. - /// - /// - /// The default TextToSpeechClient.SynthesizeSpeech and - /// TextToSpeechClient.SynthesizeSpeechAsync are: - /// - /// Initial retry delay: 100 milliseconds - /// Retry delay multiplier: 1.3 - /// Retry maximum delay: 60000 milliseconds - /// Initial timeout: 20000 milliseconds - /// Timeout multiplier: 1.0 - /// Timeout maximum delay: 20000 milliseconds - /// - /// Retry will be attempted on the following response status codes: - /// - /// No status codes - /// - /// Default RPC expiration is 600000 milliseconds. - /// - public gaxgrpc::CallSettings SynthesizeSpeechSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming( - gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings( - retryBackoff: GetDefaultRetryBackoff(), - timeoutBackoff: GetDefaultTimeoutBackoff(), - totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(600000)), - retryFilter: NonIdempotentRetryFilter - ))); - - /// - /// Creates a deep clone of this object, with all the same property values. - /// - /// A deep clone of this object. - public TextToSpeechSettings Clone() => new TextToSpeechSettings(this); - } - - /// - /// Builder class for to provide simple configuration of credentials, endpoint etc. - /// - public sealed partial class TextToSpeechClientBuilder : gaxgrpc::ClientBuilderBase - { - /// - /// The settings to use for RPCs, or null for the default settings. - /// - public TextToSpeechSettings Settings { get; set; } - - /// - public override TextToSpeechClient Build() - { - Validate(); - grpccore::CallInvoker callInvoker = CreateCallInvoker(); - return TextToSpeechClient.Create(callInvoker, Settings); - } - - /// - public override async stt::Task BuildAsync(st::CancellationToken cancellationToken = default) - { - Validate(); - grpccore::CallInvoker callInvoker = await CreateCallInvokerAsync(cancellationToken).ConfigureAwait(false); - return TextToSpeechClient.Create(callInvoker, Settings); - } - - /// - protected override gaxgrpc::ServiceEndpoint GetDefaultEndpoint() => TextToSpeechClient.DefaultEndpoint; - - /// - protected override scg::IReadOnlyList GetDefaultScopes() => TextToSpeechClient.DefaultScopes; - - /// - protected override gaxgrpc::ChannelPool GetChannelPool() => TextToSpeechClient.ChannelPool; - } - - /// - /// TextToSpeech client wrapper, for convenient use. - /// - public abstract partial class TextToSpeechClient - { - /// - /// The default endpoint for the TextToSpeech service, which is a host of "texttospeech.googleapis.com" and a port of 443. - /// - public static gaxgrpc::ServiceEndpoint DefaultEndpoint { get; } = new gaxgrpc::ServiceEndpoint("texttospeech.googleapis.com", 443); - - /// - /// The default TextToSpeech scopes. - /// - /// - /// The default TextToSpeech scopes are: - /// - /// "https://www.googleapis.com/auth/cloud-platform" - /// - /// - public static scg::IReadOnlyList DefaultScopes { get; } = new sco::ReadOnlyCollection(new string[] { - "https://www.googleapis.com/auth/cloud-platform", - }); - - private static readonly gaxgrpc::ChannelPool s_channelPool = new gaxgrpc::ChannelPool(DefaultScopes); - - internal static gaxgrpc::ChannelPool ChannelPool => s_channelPool; - - /// - /// Asynchronously creates a , applying defaults for all unspecified settings, - /// and creating a channel connecting to the given endpoint with application default credentials where - /// necessary. See the example for how to use custom credentials. - /// - /// - /// This sample shows how to create a client using default credentials: - /// - /// using Google.Cloud.TextToSpeech.V1; - /// ... - /// // When running on Google Cloud Platform this will use the project Compute Credential. - /// // Or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of a JSON - /// // credential file to use that credential. - /// TextToSpeechClient client = await TextToSpeechClient.CreateAsync(); - /// - /// This sample shows how to create a client using credentials loaded from a JSON file: - /// - /// using Google.Cloud.TextToSpeech.V1; - /// using Google.Apis.Auth.OAuth2; - /// using Grpc.Auth; - /// using Grpc.Core; - /// ... - /// GoogleCredential cred = GoogleCredential.FromFile("/path/to/credentials.json"); - /// Channel channel = new Channel( - /// TextToSpeechClient.DefaultEndpoint.Host, TextToSpeechClient.DefaultEndpoint.Port, cred.ToChannelCredentials()); - /// TextToSpeechClient client = TextToSpeechClient.Create(channel); - /// ... - /// // Shutdown the channel when it is no longer required. - /// await channel.ShutdownAsync(); - /// - /// - /// Optional . - /// Optional . - /// The task representing the created . - public static async stt::Task CreateAsync(gaxgrpc::ServiceEndpoint endpoint = null, TextToSpeechSettings settings = null) - { - grpccore::Channel channel = await s_channelPool.GetChannelAsync(endpoint ?? DefaultEndpoint).ConfigureAwait(false); - return Create(channel, settings); - } - - /// - /// Synchronously creates a , applying defaults for all unspecified settings, - /// and creating a channel connecting to the given endpoint with application default credentials where - /// necessary. See the example for how to use custom credentials. - /// - /// - /// This sample shows how to create a client using default credentials: - /// - /// using Google.Cloud.TextToSpeech.V1; - /// ... - /// // When running on Google Cloud Platform this will use the project Compute Credential. - /// // Or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of a JSON - /// // credential file to use that credential. - /// TextToSpeechClient client = TextToSpeechClient.Create(); - /// - /// This sample shows how to create a client using credentials loaded from a JSON file: - /// - /// using Google.Cloud.TextToSpeech.V1; - /// using Google.Apis.Auth.OAuth2; - /// using Grpc.Auth; - /// using Grpc.Core; - /// ... - /// GoogleCredential cred = GoogleCredential.FromFile("/path/to/credentials.json"); - /// Channel channel = new Channel( - /// TextToSpeechClient.DefaultEndpoint.Host, TextToSpeechClient.DefaultEndpoint.Port, cred.ToChannelCredentials()); - /// TextToSpeechClient client = TextToSpeechClient.Create(channel); - /// ... - /// // Shutdown the channel when it is no longer required. - /// channel.ShutdownAsync().Wait(); - /// - /// - /// Optional . - /// Optional . - /// The created . - public static TextToSpeechClient Create(gaxgrpc::ServiceEndpoint endpoint = null, TextToSpeechSettings settings = null) - { - grpccore::Channel channel = s_channelPool.GetChannel(endpoint ?? DefaultEndpoint); - return Create(channel, settings); - } - - /// - /// Creates a which uses the specified channel for remote operations. - /// - /// The for remote operations. Must not be null. - /// Optional . - /// The created . - public static TextToSpeechClient Create(grpccore::Channel channel, TextToSpeechSettings settings = null) - { - gax::GaxPreconditions.CheckNotNull(channel, nameof(channel)); - return Create(new grpccore::DefaultCallInvoker(channel), settings); - } - - /// - /// Creates a which uses the specified call invoker for remote operations. - /// - /// The for remote operations. Must not be null. - /// Optional . - /// The created . - public static TextToSpeechClient Create(grpccore::CallInvoker callInvoker, TextToSpeechSettings settings = null) - { - gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); - grpccore::Interceptors.Interceptor interceptor = settings?.Interceptor; - if (interceptor != null) - { - callInvoker = grpccore::Interceptors.CallInvokerExtensions.Intercept(callInvoker, interceptor); - } - TextToSpeech.TextToSpeechClient grpcClient = new TextToSpeech.TextToSpeechClient(callInvoker); - return new TextToSpeechClientImpl(grpcClient, settings); - } - - /// - /// Shuts down any channels automatically created by - /// and . Channels which weren't automatically - /// created are not affected. - /// - /// After calling this method, further calls to - /// and will create new channels, which could - /// in turn be shut down by another call to this method. - /// A task representing the asynchronous shutdown operation. - public static stt::Task ShutdownDefaultChannelsAsync() => s_channelPool.ShutdownChannelsAsync(); - - /// - /// The underlying gRPC TextToSpeech client. - /// - public virtual TextToSpeech.TextToSpeechClient GrpcClient - { - get { throw new sys::NotImplementedException(); } - } - - /// - /// Returns a list of Voice supported for synthesis. - /// - /// - /// Optional. Recommended. - /// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If - /// specified, the ListVoices call will only return voices that can be used to - /// synthesize this language_code. E.g. when specifying "en-NZ", you will get - /// supported "en-*" voices; when specifying "no", you will get supported - /// "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; specifying "zh" - /// will also get supported "cmn-*" voices; specifying "zh-hk" will also get - /// supported "yue-*" voices. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task ListVoicesAsync( - string languageCode, - gaxgrpc::CallSettings callSettings = null) => ListVoicesAsync( - new ListVoicesRequest - { - LanguageCode = languageCode ?? "", // Optional - }, - callSettings); - - /// - /// Returns a list of Voice supported for synthesis. - /// - /// - /// Optional. Recommended. - /// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If - /// specified, the ListVoices call will only return voices that can be used to - /// synthesize this language_code. E.g. when specifying "en-NZ", you will get - /// supported "en-*" voices; when specifying "no", you will get supported - /// "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; specifying "zh" - /// will also get supported "cmn-*" voices; specifying "zh-hk" will also get - /// supported "yue-*" voices. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task ListVoicesAsync( - string languageCode, - st::CancellationToken cancellationToken) => ListVoicesAsync( - languageCode, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Returns a list of Voice supported for synthesis. - /// - /// - /// Optional. Recommended. - /// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If - /// specified, the ListVoices call will only return voices that can be used to - /// synthesize this language_code. E.g. when specifying "en-NZ", you will get - /// supported "en-*" voices; when specifying "no", you will get supported - /// "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; specifying "zh" - /// will also get supported "cmn-*" voices; specifying "zh-hk" will also get - /// supported "yue-*" voices. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual ListVoicesResponse ListVoices( - string languageCode, - gaxgrpc::CallSettings callSettings = null) => ListVoices( - new ListVoicesRequest - { - LanguageCode = languageCode ?? "", // Optional - }, - callSettings); - - /// - /// Returns a list of Voice supported for synthesis. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task ListVoicesAsync( - ListVoicesRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Returns a list of Voice supported for synthesis. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task ListVoicesAsync( - ListVoicesRequest request, - st::CancellationToken cancellationToken) => ListVoicesAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Returns a list of Voice supported for synthesis. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual ListVoicesResponse ListVoices( - ListVoicesRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Synthesizes speech synchronously: receive results after all text input - /// has been processed. - /// - /// - /// Required. The Synthesizer requires either plain text or SSML as input. - /// - /// - /// Required. The desired voice of the synthesized audio. - /// - /// - /// Required. The configuration of the synthesized audio. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task SynthesizeSpeechAsync( - SynthesisInput input, - VoiceSelectionParams voice, - AudioConfig audioConfig, - gaxgrpc::CallSettings callSettings = null) => SynthesizeSpeechAsync( - new SynthesizeSpeechRequest - { - Input = gax::GaxPreconditions.CheckNotNull(input, nameof(input)), - Voice = gax::GaxPreconditions.CheckNotNull(voice, nameof(voice)), - AudioConfig = gax::GaxPreconditions.CheckNotNull(audioConfig, nameof(audioConfig)), - }, - callSettings); - - /// - /// Synthesizes speech synchronously: receive results after all text input - /// has been processed. - /// - /// - /// Required. The Synthesizer requires either plain text or SSML as input. - /// - /// - /// Required. The desired voice of the synthesized audio. - /// - /// - /// Required. The configuration of the synthesized audio. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task SynthesizeSpeechAsync( - SynthesisInput input, - VoiceSelectionParams voice, - AudioConfig audioConfig, - st::CancellationToken cancellationToken) => SynthesizeSpeechAsync( - input, - voice, - audioConfig, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Synthesizes speech synchronously: receive results after all text input - /// has been processed. - /// - /// - /// Required. The Synthesizer requires either plain text or SSML as input. - /// - /// - /// Required. The desired voice of the synthesized audio. - /// - /// - /// Required. The configuration of the synthesized audio. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual SynthesizeSpeechResponse SynthesizeSpeech( - SynthesisInput input, - VoiceSelectionParams voice, - AudioConfig audioConfig, - gaxgrpc::CallSettings callSettings = null) => SynthesizeSpeech( - new SynthesizeSpeechRequest - { - Input = gax::GaxPreconditions.CheckNotNull(input, nameof(input)), - Voice = gax::GaxPreconditions.CheckNotNull(voice, nameof(voice)), - AudioConfig = gax::GaxPreconditions.CheckNotNull(audioConfig, nameof(audioConfig)), - }, - callSettings); - - /// - /// Synthesizes speech synchronously: receive results after all text input - /// has been processed. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task SynthesizeSpeechAsync( - SynthesizeSpeechRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - /// - /// Synthesizes speech synchronously: receive results after all text input - /// has been processed. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// A to use for this RPC. - /// - /// - /// A Task containing the RPC response. - /// - public virtual stt::Task SynthesizeSpeechAsync( - SynthesizeSpeechRequest request, - st::CancellationToken cancellationToken) => SynthesizeSpeechAsync( - request, - gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); - - /// - /// Synthesizes speech synchronously: receive results after all text input - /// has been processed. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public virtual SynthesizeSpeechResponse SynthesizeSpeech( - SynthesizeSpeechRequest request, - gaxgrpc::CallSettings callSettings = null) - { - throw new sys::NotImplementedException(); - } - - } - - /// - /// TextToSpeech client wrapper implementation, for convenient use. - /// - public sealed partial class TextToSpeechClientImpl : TextToSpeechClient - { - private readonly gaxgrpc::ApiCall _callListVoices; - private readonly gaxgrpc::ApiCall _callSynthesizeSpeech; - - /// - /// Constructs a client wrapper for the TextToSpeech service, with the specified gRPC client and settings. - /// - /// The underlying gRPC client. - /// The base used within this client - public TextToSpeechClientImpl(TextToSpeech.TextToSpeechClient grpcClient, TextToSpeechSettings settings) - { - GrpcClient = grpcClient; - TextToSpeechSettings effectiveSettings = settings ?? TextToSpeechSettings.GetDefault(); - gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); - _callListVoices = clientHelper.BuildApiCall( - GrpcClient.ListVoicesAsync, GrpcClient.ListVoices, effectiveSettings.ListVoicesSettings); - _callSynthesizeSpeech = clientHelper.BuildApiCall( - GrpcClient.SynthesizeSpeechAsync, GrpcClient.SynthesizeSpeech, effectiveSettings.SynthesizeSpeechSettings); - Modify_ApiCall(ref _callListVoices); - Modify_ListVoicesApiCall(ref _callListVoices); - Modify_ApiCall(ref _callSynthesizeSpeech); - Modify_SynthesizeSpeechApiCall(ref _callSynthesizeSpeech); - OnConstruction(grpcClient, effectiveSettings, clientHelper); - } - - // Partial methods are named to (mostly) ensure there cannot be conflicts with RPC method names. - - // Partial methods called for every ApiCall on construction. - // Allows modification of all the underlying ApiCall objects. - partial void Modify_ApiCall(ref gaxgrpc::ApiCall call) - where TRequest : class, pb::IMessage - where TResponse : class, pb::IMessage; - - // Partial methods called for each ApiCall on construction. - // Allows per-RPC-method modification of the underlying ApiCall object. - partial void Modify_ListVoicesApiCall(ref gaxgrpc::ApiCall call); - partial void Modify_SynthesizeSpeechApiCall(ref gaxgrpc::ApiCall call); - partial void OnConstruction(TextToSpeech.TextToSpeechClient grpcClient, TextToSpeechSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper); - - /// - /// The underlying gRPC TextToSpeech client. - /// - public override TextToSpeech.TextToSpeechClient GrpcClient { get; } - - // Partial methods called on each request. - // Allows per-RPC-call modification to the request and CallSettings objects, - // before the underlying RPC is performed. - partial void Modify_ListVoicesRequest(ref ListVoicesRequest request, ref gaxgrpc::CallSettings settings); - partial void Modify_SynthesizeSpeechRequest(ref SynthesizeSpeechRequest request, ref gaxgrpc::CallSettings settings); - - /// - /// Returns a list of Voice supported for synthesis. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public override stt::Task ListVoicesAsync( - ListVoicesRequest request, - gaxgrpc::CallSettings callSettings = null) - { - Modify_ListVoicesRequest(ref request, ref callSettings); - return _callListVoices.Async(request, callSettings); - } - - /// - /// Returns a list of Voice supported for synthesis. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public override ListVoicesResponse ListVoices( - ListVoicesRequest request, - gaxgrpc::CallSettings callSettings = null) - { - Modify_ListVoicesRequest(ref request, ref callSettings); - return _callListVoices.Sync(request, callSettings); - } - - /// - /// Synthesizes speech synchronously: receive results after all text input - /// has been processed. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// A Task containing the RPC response. - /// - public override stt::Task SynthesizeSpeechAsync( - SynthesizeSpeechRequest request, - gaxgrpc::CallSettings callSettings = null) - { - Modify_SynthesizeSpeechRequest(ref request, ref callSettings); - return _callSynthesizeSpeech.Async(request, callSettings); - } - - /// - /// Synthesizes speech synchronously: receive results after all text input - /// has been processed. - /// - /// - /// The request object containing all of the parameters for the API call. - /// - /// - /// If not null, applies overrides to this RPC call. - /// - /// - /// The RPC response. - /// - public override SynthesizeSpeechResponse SynthesizeSpeech( - SynthesizeSpeechRequest request, - gaxgrpc::CallSettings callSettings = null) - { - Modify_SynthesizeSpeechRequest(ref request, ref callSettings); - return _callSynthesizeSpeech.Sync(request, callSettings); - } - - } - - // Partial classes to enable page-streaming - - -} diff --git a/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1/TextToSpeechClient.g.cs b/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1/TextToSpeechClient.g.cs new file mode 100644 index 000000000000..717f105a44a9 --- /dev/null +++ b/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1/TextToSpeechClient.g.cs @@ -0,0 +1,516 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated code. DO NOT EDIT! + +using gax = Google.Api.Gax; +using gaxgrpc = Google.Api.Gax.Grpc; +using proto = Google.Protobuf; +using grpccore = Grpc.Core; +using grpcinter = Grpc.Core.Interceptors; +using sys = System; +using scg = System.Collections.Generic; +using sco = System.Collections.ObjectModel; +using st = System.Threading; +using stt = System.Threading.Tasks; + +namespace Google.Cloud.TextToSpeech.V1 +{ + /// Settings for instances. + public sealed partial class TextToSpeechSettings : gaxgrpc::ServiceSettingsBase + { + /// Get a new instance of the default . + /// A new instance of the default . + public static TextToSpeechSettings GetDefault() => new TextToSpeechSettings(); + + /// Constructs a new object with default settings. + public TextToSpeechSettings() + { + } + + private TextToSpeechSettings(TextToSpeechSettings existing) : base(existing) + { + gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); + ListVoicesSettings = existing.ListVoicesSettings; + SynthesizeSpeechSettings = existing.SynthesizeSpeechSettings; + OnCopy(existing); + } + + partial void OnCopy(TextToSpeechSettings existing); + + /// + /// for synchronous and asynchronous calls to + /// TextToSpeechClient.ListVoices and TextToSpeechClient.ListVoicesAsync. + /// + /// + /// + /// Initial retry delay: 600000 milliseconds. + /// Retry delay multiplier: 1 + /// Retry maximum delay: 600000 milliseconds. + /// Initial timeout: 100 milliseconds. + /// Timeout multiplier: 1.29999995231628 + /// Timeout maximum delay: 60000 milliseconds. + /// Total timeout: 600 seconds. + /// + /// + public gaxgrpc::CallSettings ListVoicesSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming(gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings(retryBackoff: new gaxgrpc::BackoffSettings(delay: sys::TimeSpan.FromMilliseconds(600000), maxDelay: sys::TimeSpan.FromMilliseconds(600000), delayMultiplier: 1), timeoutBackoff: new gaxgrpc::BackoffSettings(delay: sys::TimeSpan.FromMilliseconds(100), maxDelay: sys::TimeSpan.FromMilliseconds(60000), delayMultiplier: 1.2999999523162842), totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(600000)), retryFilter: gaxgrpc::RetrySettings.FilterForStatusCodes(grpccore::StatusCode.Unavailable, grpccore::StatusCode.DeadlineExceeded)))); + + /// + /// for synchronous and asynchronous calls to + /// TextToSpeechClient.SynthesizeSpeech and TextToSpeechClient.SynthesizeSpeechAsync. + /// + /// + /// + /// Initial retry delay: 600000 milliseconds. + /// Retry delay multiplier: 1 + /// Retry maximum delay: 600000 milliseconds. + /// Initial timeout: 100 milliseconds. + /// Timeout multiplier: 1.29999995231628 + /// Timeout maximum delay: 60000 milliseconds. + /// Total timeout: 600 seconds. + /// + /// + public gaxgrpc::CallSettings SynthesizeSpeechSettings { get; set; } = gaxgrpc::CallSettings.FromCallTiming(gaxgrpc::CallTiming.FromRetry(new gaxgrpc::RetrySettings(retryBackoff: new gaxgrpc::BackoffSettings(delay: sys::TimeSpan.FromMilliseconds(600000), maxDelay: sys::TimeSpan.FromMilliseconds(600000), delayMultiplier: 1), timeoutBackoff: new gaxgrpc::BackoffSettings(delay: sys::TimeSpan.FromMilliseconds(100), maxDelay: sys::TimeSpan.FromMilliseconds(60000), delayMultiplier: 1.2999999523162842), totalExpiration: gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(600000)), retryFilter: gaxgrpc::RetrySettings.FilterForStatusCodes(grpccore::StatusCode.Unavailable, grpccore::StatusCode.DeadlineExceeded)))); + + /// Creates a deep clone of this object, with all the same property values. + /// A deep clone of this object. + public TextToSpeechSettings Clone() => new TextToSpeechSettings(this); + } + + /// TextToSpeech client wrapper, for convenient use. + public abstract partial class TextToSpeechClient + { + /// + /// The default endpoint for the TextToSpeech service, which is a host of "texttospeech.googleapis.com" and a + /// port of 443. + /// + public static gaxgrpc::ServiceEndpoint DefaultEndpoint { get; } = new gaxgrpc::ServiceEndpoint("texttospeech.googleapis.com", 443); + + /// The default TextToSpeech scopes. + /// + /// The default TextToSpeech scopes are: + /// + /// https://www.googleapis.com/auth/cloud-platform + /// + /// + public static scg::IReadOnlyList DefaultScopes { get; } = new sco::ReadOnlyCollection(new string[] + { + "https://www.googleapis.com/auth/cloud-platform", + }); + + private static readonly gaxgrpc::ChannelPool s_channelPool = new gaxgrpc::ChannelPool(DefaultScopes); + + /// + /// Asynchronously creates a , applying defaults for all unspecified settings, + /// and creating a channel connecting to the given endpoint with application default credentials where + /// necessary. See the example for how to use custom credentials. + /// + /// + /// This sample shows how to create a client using default credentials: + /// + /// using Google.Cloud.Vision.V1; + /// ... + /// // When running on Google Cloud Platform this will use the project Compute Credential. + /// // Or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of a JSON + /// // credential file to use that credential. + /// ImageAnnotatorClient client = await ImageAnnotatorClient.CreateAsync(); + /// + /// This sample shows how to create a client using credentials loaded from a JSON file: + /// + /// using Google.Cloud.Vision.V1; + /// using Google.Apis.Auth.OAuth2; + /// using Grpc.Auth; + /// using Grpc.Core; + /// ... + /// GoogleCredential cred = GoogleCredential.FromFile("/path/to/credentials.json"); + /// Channel channel = new Channel( + /// ImageAnnotatorClient.DefaultEndpoint.Host, ImageAnnotatorClient.DefaultEndpoint.Port, cred.ToChannelCredentials()); + /// ImageAnnotatorClient client = ImageAnnotatorClient.Create(channel); + /// ... + /// // Shutdown the channel when it is no longer required. + /// await channel.ShutdownAsync(); + /// + /// + /// Optional . + /// Optional . + /// The task representing the created . + public static async stt::Task CreateAsync(gaxgrpc::ServiceEndpoint endpoint = null, TextToSpeechSettings settings = null) + { + grpccore::Channel channel = await s_channelPool.GetChannelAsync(endpoint ?? DefaultEndpoint).ConfigureAwait(false); + return Create(channel, settings); + } + + /// + /// Synchronously creates a , applying defaults for all unspecified settings, + /// and creating a channel connecting to the given endpoint with application default credentials where + /// necessary. See the example for how to use custom credentials. + /// + /// + /// This sample shows how to create a client using default credentials: + /// + /// using Google.Cloud.Vision.V1; + /// ... + /// // When running on Google Cloud Platform this will use the project Compute Credential. + /// // Or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of a JSON + /// // credential file to use that credential. + /// ImageAnnotatorClient client = ImageAnnotatorClient.Create(); + /// + /// This sample shows how to create a client using credentials loaded from a JSON file: + /// + /// using Google.Cloud.Vision.V1; + /// using Google.Apis.Auth.OAuth2; + /// using Grpc.Auth; + /// using Grpc.Core; + /// ... + /// GoogleCredential cred = GoogleCredential.FromFile("/path/to/credentials.json"); + /// Channel channel = new Channel( + /// ImageAnnotatorClient.DefaultEndpoint.Host, ImageAnnotatorClient.DefaultEndpoint.Port, cred.ToChannelCredentials()); + /// ImageAnnotatorClient client = ImageAnnotatorClient.Create(channel); + /// ... + /// // Shutdown the channel when it is no longer required. + /// channel.ShutdownAsync().Wait(); + /// + /// + /// Optional . + /// Optional . + /// The created . + public static TextToSpeechClient Create(gaxgrpc::ServiceEndpoint endpoint = null, TextToSpeechSettings settings = null) + { + grpccore::Channel channel = s_channelPool.GetChannel(endpoint ?? DefaultEndpoint); + return Create(channel, settings); + } + + /// + /// Creates a which uses the specified channel for remote operations. + /// + /// The for remote operations. Must not be null. + /// Optional . + /// The created . + public static TextToSpeechClient Create(grpccore::Channel channel, TextToSpeechSettings settings = null) + { + gax::GaxPreconditions.CheckNotNull(channel, nameof(channel)); + return Create(new grpccore::DefaultCallInvoker(channel), settings); + } + + /// + /// Creates a which uses the specified call invoker for remote operations. + /// + /// + /// The for remote operations. Must not be null. + /// + /// Optional . + /// The created . + public static TextToSpeechClient Create(grpccore::CallInvoker callInvoker, TextToSpeechSettings settings = null) + { + gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); + grpcinter::Interceptor interceptor = settings?.Interceptor; + if (interceptor != null) + { + callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor); + } + TextToSpeech.TextToSpeechClient grpcClient = new TextToSpeech.TextToSpeechClient(callInvoker); + return new TextToSpeechClientImpl(grpcClient, settings); + } + + /// + /// Shuts down any channels automatically created by + /// and + /// . Channels which weren't + /// automatically created are not affected. + /// + /// + /// After calling this method, further calls to + /// and will create new channels, which + /// could in turn be shut down by another call to this method. + /// + /// A task representing the asynchronous shutdown operation. + public static stt::Task ShutdownDefaultChannelsAsync() => s_channelPool.ShutdownChannelsAsync(); + + /// The underlying gRPC TextToSpeech client + public virtual TextToSpeech.TextToSpeechClient GrpcClient => throw new sys::NotImplementedException(); + + /// + /// Returns a list of Voice supported for synthesis. + /// + /// The request object containing all of the parameters for the API call. + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public virtual ListVoicesResponse ListVoices(ListVoicesRequest request, gaxgrpc::CallSettings callSettings = null) => + throw new sys::NotImplementedException(); + + /// + /// Returns a list of Voice supported for synthesis. + /// + /// The request object containing all of the parameters for the API call. + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public virtual stt::Task ListVoicesAsync(ListVoicesRequest request, gaxgrpc::CallSettings callSettings = null) => + throw new sys::NotImplementedException(); + + /// + /// Returns a list of Voice supported for synthesis. + /// + /// The request object containing all of the parameters for the API call. + /// A to use for this RPC. + /// A Task containing the RPC response. + public virtual stt::Task ListVoicesAsync(ListVoicesRequest request, st::CancellationToken cancellationToken) => + ListVoicesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Returns a list of Voice supported for synthesis. + /// + /// + /// Optional. Recommended. + /// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If + /// specified, the ListVoices call will only return voices that can be used to + /// synthesize this language_code. E.g. when specifying "en-NZ", you will get + /// supported "en-*" voices; when specifying "no", you will get supported + /// "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; specifying "zh" + /// will also get supported "cmn-*" voices; specifying "zh-hk" will also get + /// supported "yue-*" voices. + /// + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public virtual ListVoicesResponse ListVoices(string languageCode, gaxgrpc::CallSettings callSettings = null) => + ListVoices(new ListVoicesRequest + { + LanguageCode = languageCode ?? "", + }, callSettings); + + /// + /// Returns a list of Voice supported for synthesis. + /// + /// + /// Optional. Recommended. + /// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If + /// specified, the ListVoices call will only return voices that can be used to + /// synthesize this language_code. E.g. when specifying "en-NZ", you will get + /// supported "en-*" voices; when specifying "no", you will get supported + /// "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; specifying "zh" + /// will also get supported "cmn-*" voices; specifying "zh-hk" will also get + /// supported "yue-*" voices. + /// + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public virtual stt::Task ListVoicesAsync(string languageCode, gaxgrpc::CallSettings callSettings = null) => + ListVoicesAsync(new ListVoicesRequest + { + LanguageCode = languageCode ?? "", + }, callSettings); + + /// + /// Returns a list of Voice supported for synthesis. + /// + /// + /// Optional. Recommended. + /// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If + /// specified, the ListVoices call will only return voices that can be used to + /// synthesize this language_code. E.g. when specifying "en-NZ", you will get + /// supported "en-*" voices; when specifying "no", you will get supported + /// "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; specifying "zh" + /// will also get supported "cmn-*" voices; specifying "zh-hk" will also get + /// supported "yue-*" voices. + /// + /// A to use for this RPC. + /// A Task containing the RPC response. + public virtual stt::Task ListVoicesAsync(string languageCode, st::CancellationToken cancellationToken) => + ListVoicesAsync(languageCode, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Synthesizes speech synchronously: receive results after all text input + /// has been processed. + /// + /// The request object containing all of the parameters for the API call. + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public virtual SynthesizeSpeechResponse SynthesizeSpeech(SynthesizeSpeechRequest request, gaxgrpc::CallSettings callSettings = null) => + throw new sys::NotImplementedException(); + + /// + /// Synthesizes speech synchronously: receive results after all text input + /// has been processed. + /// + /// The request object containing all of the parameters for the API call. + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public virtual stt::Task SynthesizeSpeechAsync(SynthesizeSpeechRequest request, gaxgrpc::CallSettings callSettings = null) => + throw new sys::NotImplementedException(); + + /// + /// Synthesizes speech synchronously: receive results after all text input + /// has been processed. + /// + /// The request object containing all of the parameters for the API call. + /// A to use for this RPC. + /// A Task containing the RPC response. + public virtual stt::Task SynthesizeSpeechAsync(SynthesizeSpeechRequest request, st::CancellationToken cancellationToken) => + SynthesizeSpeechAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Synthesizes speech synchronously: receive results after all text input + /// has been processed. + /// + /// + /// Required. The Synthesizer requires either plain text or SSML as input. + /// + /// + /// Required. The desired voice of the synthesized audio. + /// + /// + /// Required. The configuration of the synthesized audio. + /// + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public virtual SynthesizeSpeechResponse SynthesizeSpeech(SynthesisInput input, VoiceSelectionParams voice, AudioConfig audioConfig, gaxgrpc::CallSettings callSettings = null) => + SynthesizeSpeech(new SynthesizeSpeechRequest + { + Input = gax::GaxPreconditions.CheckNotNull(input, nameof(input)), + Voice = gax::GaxPreconditions.CheckNotNull(voice, nameof(voice)), + AudioConfig = gax::GaxPreconditions.CheckNotNull(audioConfig, nameof(audioConfig)), + }, callSettings); + + /// + /// Synthesizes speech synchronously: receive results after all text input + /// has been processed. + /// + /// + /// Required. The Synthesizer requires either plain text or SSML as input. + /// + /// + /// Required. The desired voice of the synthesized audio. + /// + /// + /// Required. The configuration of the synthesized audio. + /// + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public virtual stt::Task SynthesizeSpeechAsync(SynthesisInput input, VoiceSelectionParams voice, AudioConfig audioConfig, gaxgrpc::CallSettings callSettings = null) => + SynthesizeSpeechAsync(new SynthesizeSpeechRequest + { + Input = gax::GaxPreconditions.CheckNotNull(input, nameof(input)), + Voice = gax::GaxPreconditions.CheckNotNull(voice, nameof(voice)), + AudioConfig = gax::GaxPreconditions.CheckNotNull(audioConfig, nameof(audioConfig)), + }, callSettings); + + /// + /// Synthesizes speech synchronously: receive results after all text input + /// has been processed. + /// + /// + /// Required. The Synthesizer requires either plain text or SSML as input. + /// + /// + /// Required. The desired voice of the synthesized audio. + /// + /// + /// Required. The configuration of the synthesized audio. + /// + /// A to use for this RPC. + /// A Task containing the RPC response. + public virtual stt::Task SynthesizeSpeechAsync(SynthesisInput input, VoiceSelectionParams voice, AudioConfig audioConfig, st::CancellationToken cancellationToken) => + SynthesizeSpeechAsync(input, voice, audioConfig, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + } + + /// TextToSpeech client wrapper implementation, for convenient use. + public sealed partial class TextToSpeechClientImpl : TextToSpeechClient + { + private readonly gaxgrpc::ApiCall _callListVoices; + + private readonly gaxgrpc::ApiCall _callSynthesizeSpeech; + + /// + /// Constructs a client wrapper for the TextToSpeech service, with the specified gRPC client and settings. + /// + /// The underlying gRPC client. + /// The base used within this client. + public TextToSpeechClientImpl(TextToSpeech.TextToSpeechClient grpcClient, TextToSpeechSettings settings) + { + GrpcClient = grpcClient; + TextToSpeechSettings effectiveSettings = settings ?? TextToSpeechSettings.GetDefault(); + gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + _callListVoices = clientHelper.BuildApiCall(grpcClient.ListVoicesAsync, grpcClient.ListVoices, effectiveSettings.ListVoicesSettings); + Modify_ApiCall(ref _callListVoices); + Modify_ListVoicesApiCall(ref _callListVoices); + _callSynthesizeSpeech = clientHelper.BuildApiCall(grpcClient.SynthesizeSpeechAsync, grpcClient.SynthesizeSpeech, effectiveSettings.SynthesizeSpeechSettings); + Modify_ApiCall(ref _callSynthesizeSpeech); + Modify_SynthesizeSpeechApiCall(ref _callSynthesizeSpeech); + OnConstruction(grpcClient, effectiveSettings, clientHelper); + } + + partial void Modify_ApiCall(ref gaxgrpc::ApiCall call) where TRequest : class, proto::IMessage where TResponse : class, proto::IMessage; + + partial void Modify_ListVoicesApiCall(ref gaxgrpc::ApiCall call); + + partial void Modify_SynthesizeSpeechApiCall(ref gaxgrpc::ApiCall call); + + partial void OnConstruction(TextToSpeech.TextToSpeechClient grpcClient, TextToSpeechSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper); + + /// The underlying gRPC TextToSpeech client + public override TextToSpeech.TextToSpeechClient GrpcClient { get; } + + partial void Modify_ListVoicesRequest(ref ListVoicesRequest request, ref gaxgrpc::CallSettings settings); + + partial void Modify_SynthesizeSpeechRequest(ref SynthesizeSpeechRequest request, ref gaxgrpc::CallSettings settings); + + /// + /// Returns a list of Voice supported for synthesis. + /// + /// The request object containing all of the parameters for the API call. + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public override ListVoicesResponse ListVoices(ListVoicesRequest request, gaxgrpc::CallSettings callSettings = null) + { + Modify_ListVoicesRequest(ref request, ref callSettings); + return _callListVoices.Sync(request, callSettings); + } + + /// + /// Returns a list of Voice supported for synthesis. + /// + /// The request object containing all of the parameters for the API call. + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public override stt::Task ListVoicesAsync(ListVoicesRequest request, gaxgrpc::CallSettings callSettings = null) + { + Modify_ListVoicesRequest(ref request, ref callSettings); + return _callListVoices.Async(request, callSettings); + } + + /// + /// Synthesizes speech synchronously: receive results after all text input + /// has been processed. + /// + /// The request object containing all of the parameters for the API call. + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public override SynthesizeSpeechResponse SynthesizeSpeech(SynthesizeSpeechRequest request, gaxgrpc::CallSettings callSettings = null) + { + Modify_SynthesizeSpeechRequest(ref request, ref callSettings); + return _callSynthesizeSpeech.Sync(request, callSettings); + } + + /// + /// Synthesizes speech synchronously: receive results after all text input + /// has been processed. + /// + /// The request object containing all of the parameters for the API call. + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public override stt::Task SynthesizeSpeechAsync(SynthesizeSpeechRequest request, gaxgrpc::CallSettings callSettings = null) + { + Modify_SynthesizeSpeechRequest(ref request, ref callSettings); + return _callSynthesizeSpeech.Async(request, callSettings); + } + } +}