Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
docs: generate sample code in the Java microgenerator (#216)
Browse files Browse the repository at this point in the history
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/89565b2d-2643-4c84-a434-564a46601538/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 356341083
Source-Link: googleapis/googleapis@8d8c008
  • Loading branch information
yoshi-automation committed Feb 9, 2021
1 parent 42369d2 commit bbe7c7e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
Expand Up @@ -32,6 +32,20 @@
* <p>This class provides the ability to make remote calls to the backing service through method
* calls that map to API methods. Sample code to get started:
*
* <pre>{@code
* try (SpeechTranslationServiceClient speechTranslationServiceClient =
* SpeechTranslationServiceClient.create()) {
* BidiStream<StreamingTranslateSpeechRequest, StreamingTranslateSpeechResponse> bidiStream =
* speechTranslationServiceClient.streamingTranslateSpeechCallable().call();
* StreamingTranslateSpeechRequest request =
* StreamingTranslateSpeechRequest.newBuilder().build();
* bidiStream.send(request);
* for (StreamingTranslateSpeechResponse response : bidiStream) {
* // Do something when a response is received.
* }
* }
* }</pre>
*
* <p>Note: close() needs to be called on the SpeechTranslationServiceClient object to clean up
* resources such as threads. In the example above, try-with-resources is used, which automatically
* calls close().
Expand Down Expand Up @@ -143,6 +157,20 @@ public SpeechTranslationServiceStub getStub() {
* method is only available via the gRPC API (not REST).
*
* <p>Sample code:
*
* <pre>{@code
* try (SpeechTranslationServiceClient speechTranslationServiceClient =
* SpeechTranslationServiceClient.create()) {
* BidiStream<StreamingTranslateSpeechRequest, StreamingTranslateSpeechResponse> bidiStream =
* speechTranslationServiceClient.streamingTranslateSpeechCallable().call();
* StreamingTranslateSpeechRequest request =
* StreamingTranslateSpeechRequest.newBuilder().build();
* bidiStream.send(request);
* for (StreamingTranslateSpeechResponse response : bidiStream) {
* // Do something when a response is received.
* }
* }
* }</pre>
*/
public final BidiStreamingCallable<
StreamingTranslateSpeechRequest, StreamingTranslateSpeechResponse>
Expand Down
Expand Up @@ -22,6 +22,20 @@
* <p>Service Description: Provides translation from/to media types.
*
* <p>Sample for SpeechTranslationServiceClient:
*
* <pre>{@code
* try (SpeechTranslationServiceClient speechTranslationServiceClient =
* SpeechTranslationServiceClient.create()) {
* BidiStream<StreamingTranslateSpeechRequest, StreamingTranslateSpeechResponse> bidiStream =
* speechTranslationServiceClient.streamingTranslateSpeechCallable().call();
* StreamingTranslateSpeechRequest request =
* StreamingTranslateSpeechRequest.newBuilder().build();
* bidiStream.send(request);
* for (StreamingTranslateSpeechResponse response : bidiStream) {
* // Do something when a response is received.
* }
* }
* }</pre>
*/
@Generated("by gapic-generator-java")
package com.google.cloud.mediatranslation.v1beta1;
Expand Down
6 changes: 3 additions & 3 deletions synth.metadata
Expand Up @@ -4,15 +4,15 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-mediatranslation.git",
"sha": "131e6a53ebc995937c360169e661533f57e81301"
"sha": "42369d29e7ad794f3b8afb00e1443a4f66db95bd"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3",
"internalRef": "350949863"
"sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb",
"internalRef": "356341083"
}
},
{
Expand Down

0 comments on commit bbe7c7e

Please sign in to comment.