-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PiperOrigin-RevId: 493338018 Source-Link: googleapis/googleapis@380b2f0 Source-Link: googleapis/googleapis-gen@5802e4b Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuVGV4dFRvU3BlZWNoLlYxQmV0YTEvLk93bEJvdC55YW1sIiwiaCI6IjU4MDJlNGJkMjQ0ZjExYWJmODhjOGVlMzk2OGRjMWQ3MjgxYzQ5NmEifQ==
- Loading branch information
1 parent
5491c8f
commit 96674eb
Showing
14 changed files
with
1,843 additions
and
7 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
...s/TextToSpeechLongAudioSynthesizeClient.SynthesizeLongAudioRequestObjectAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Copyright 2022 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! | ||
|
||
namespace Google.Cloud.TextToSpeech.V1Beta1.Snippets | ||
{ | ||
// [START texttospeech_v1beta1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_async] | ||
using Google.Cloud.TextToSpeech.V1Beta1; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedTextToSpeechLongAudioSynthesizeClientSnippets | ||
{ | ||
/// <summary>Snippet for SynthesizeLongAudioAsync</summary> | ||
/// <remarks> | ||
/// 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. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task SynthesizeLongAudioRequestObjectAsync() | ||
{ | ||
// Create client | ||
TextToSpeechLongAudioSynthesizeClient textToSpeechLongAudioSynthesizeClient = await TextToSpeechLongAudioSynthesizeClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
SynthesizeLongAudioRequest request = new SynthesizeLongAudioRequest | ||
{ | ||
Parent = "", | ||
Input = new SynthesisInput(), | ||
AudioConfig = new AudioConfig(), | ||
OutputGcsUri = "", | ||
Voice = new VoiceSelectionParams(), | ||
}; | ||
// Make the request | ||
Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> response = await textToSpeechLongAudioSynthesizeClient.SynthesizeLongAudioAsync(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
SynthesizeLongAudioResponse result = completedResponse.Result; | ||
|
||
// Or get the name of the operation | ||
string operationName = response.Name; | ||
// This name can be stored, then the long-running operation retrieved later by name | ||
Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> retrievedResponse = await textToSpeechLongAudioSynthesizeClient.PollOnceSynthesizeLongAudioAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
SynthesizeLongAudioResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END texttospeech_v1beta1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_async] | ||
} |
67 changes: 67 additions & 0 deletions
67
...ippets/TextToSpeechLongAudioSynthesizeClient.SynthesizeLongAudioRequestObjectSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Copyright 2022 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! | ||
|
||
namespace Google.Cloud.TextToSpeech.V1Beta1.Snippets | ||
{ | ||
// [START texttospeech_v1beta1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync] | ||
using Google.Cloud.TextToSpeech.V1Beta1; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedTextToSpeechLongAudioSynthesizeClientSnippets | ||
{ | ||
/// <summary>Snippet for SynthesizeLongAudio</summary> | ||
/// <remarks> | ||
/// 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. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public void SynthesizeLongAudioRequestObject() | ||
{ | ||
// Create client | ||
TextToSpeechLongAudioSynthesizeClient textToSpeechLongAudioSynthesizeClient = TextToSpeechLongAudioSynthesizeClient.Create(); | ||
// Initialize request argument(s) | ||
SynthesizeLongAudioRequest request = new SynthesizeLongAudioRequest | ||
{ | ||
Parent = "", | ||
Input = new SynthesisInput(), | ||
AudioConfig = new AudioConfig(), | ||
OutputGcsUri = "", | ||
Voice = new VoiceSelectionParams(), | ||
}; | ||
// Make the request | ||
Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> response = textToSpeechLongAudioSynthesizeClient.SynthesizeLongAudio(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
SynthesizeLongAudioResponse result = completedResponse.Result; | ||
|
||
// Or get the name of the operation | ||
string operationName = response.Name; | ||
// This name can be stored, then the long-running operation retrieved later by name | ||
Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> retrievedResponse = textToSpeechLongAudioSynthesizeClient.PollOnceSynthesizeLongAudio(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
SynthesizeLongAudioResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END texttospeech_v1beta1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
...le.Cloud.TextToSpeech.V1Beta1.Snippets/TextToSpeechLongAudioSynthesizeClientSnippets.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
// Copyright 2022 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! | ||
|
||
namespace Google.Cloud.TextToSpeech.V1Beta1.Snippets | ||
{ | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
/// <summary>Generated snippets.</summary> | ||
public sealed class AllGeneratedTextToSpeechLongAudioSynthesizeClientSnippets | ||
{ | ||
/// <summary>Snippet for SynthesizeLongAudio</summary> | ||
public void SynthesizeLongAudioRequestObject() | ||
{ | ||
// Snippet: SynthesizeLongAudio(SynthesizeLongAudioRequest, CallSettings) | ||
// Create client | ||
TextToSpeechLongAudioSynthesizeClient textToSpeechLongAudioSynthesizeClient = TextToSpeechLongAudioSynthesizeClient.Create(); | ||
// Initialize request argument(s) | ||
SynthesizeLongAudioRequest request = new SynthesizeLongAudioRequest | ||
{ | ||
Parent = "", | ||
Input = new SynthesisInput(), | ||
AudioConfig = new AudioConfig(), | ||
OutputGcsUri = "", | ||
Voice = new VoiceSelectionParams(), | ||
}; | ||
// Make the request | ||
Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> response = textToSpeechLongAudioSynthesizeClient.SynthesizeLongAudio(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
SynthesizeLongAudioResponse result = completedResponse.Result; | ||
|
||
// Or get the name of the operation | ||
string operationName = response.Name; | ||
// This name can be stored, then the long-running operation retrieved later by name | ||
Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> retrievedResponse = textToSpeechLongAudioSynthesizeClient.PollOnceSynthesizeLongAudio(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
SynthesizeLongAudioResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
// End snippet | ||
} | ||
|
||
/// <summary>Snippet for SynthesizeLongAudioAsync</summary> | ||
public async Task SynthesizeLongAudioRequestObjectAsync() | ||
{ | ||
// Snippet: SynthesizeLongAudioAsync(SynthesizeLongAudioRequest, CallSettings) | ||
// Additional: SynthesizeLongAudioAsync(SynthesizeLongAudioRequest, CancellationToken) | ||
// Create client | ||
TextToSpeechLongAudioSynthesizeClient textToSpeechLongAudioSynthesizeClient = await TextToSpeechLongAudioSynthesizeClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
SynthesizeLongAudioRequest request = new SynthesizeLongAudioRequest | ||
{ | ||
Parent = "", | ||
Input = new SynthesisInput(), | ||
AudioConfig = new AudioConfig(), | ||
OutputGcsUri = "", | ||
Voice = new VoiceSelectionParams(), | ||
}; | ||
// Make the request | ||
Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> response = await textToSpeechLongAudioSynthesizeClient.SynthesizeLongAudioAsync(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
SynthesizeLongAudioResponse result = completedResponse.Result; | ||
|
||
// Or get the name of the operation | ||
string operationName = response.Name; | ||
// This name can be stored, then the long-running operation retrieved later by name | ||
Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> retrievedResponse = await textToSpeechLongAudioSynthesizeClient.PollOnceSynthesizeLongAudioAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
SynthesizeLongAudioResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
// End snippet | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.