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 (#395)
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/b5715173-fa09-4f29-8c69-530ae787b970/targets

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

PiperOrigin-RevId: 356341083
Source-Link: googleapis/googleapis@8d8c008
  • Loading branch information
yoshi-automation committed Feb 16, 2021
1 parent 3fc5bf8 commit b725c3a
Show file tree
Hide file tree
Showing 14 changed files with 490 additions and 4 deletions.
Expand Up @@ -37,6 +37,16 @@
* <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 (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* String inputUri = "inputUri470706498";
* List<Feature> features = new ArrayList<>();
* AnnotateVideoResponse response =
* videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
* }
* }</pre>
*
* <p>Note: close() needs to be called on the VideoIntelligenceServiceClient 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 @@ -159,6 +169,18 @@ public final OperationsClient getOperationsClient() {
* `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse`
* (results).
*
* <p>Sample code:
*
* <pre>{@code
* try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* String inputUri = "inputUri470706498";
* List<Feature> features = new ArrayList<>();
* AnnotateVideoResponse response =
* videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
* }
* }</pre>
*
* @param inputUri Input video location. Currently, only [Cloud
* Storage](https://cloud.google.com/storage/) URIs are supported. URIs must be specified in
* the following format: `gs://bucket-id/object-id` (other URI formats return
Expand All @@ -185,6 +207,25 @@ public final OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> annot
* `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse`
* (results).
*
* <p>Sample code:
*
* <pre>{@code
* try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* AnnotateVideoRequest request =
* AnnotateVideoRequest.newBuilder()
* .setInputUri("inputUri470706498")
* .setInputContent(ByteString.EMPTY)
* .addAllFeatures(new ArrayList<Feature>())
* .setVideoContext(VideoContext.newBuilder().build())
* .setOutputUri("outputUri-2119300949")
* .setLocationId("locationId1541836720")
* .build();
* AnnotateVideoResponse response =
* videoIntelligenceServiceClient.annotateVideoAsync(request).get();
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand All @@ -201,6 +242,25 @@ public final OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> annot
* (results).
*
* <p>Sample code:
*
* <pre>{@code
* try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* AnnotateVideoRequest request =
* AnnotateVideoRequest.newBuilder()
* .setInputUri("inputUri470706498")
* .setInputContent(ByteString.EMPTY)
* .addAllFeatures(new ArrayList<Feature>())
* .setVideoContext(VideoContext.newBuilder().build())
* .setOutputUri("outputUri-2119300949")
* .setLocationId("locationId1541836720")
* .build();
* OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> future =
* videoIntelligenceServiceClient.annotateVideoOperationCallable().futureCall(request);
* // Do something.
* AnnotateVideoResponse response = future.get();
* }
* }</pre>
*/
public final OperationCallable<AnnotateVideoRequest, AnnotateVideoResponse, AnnotateVideoProgress>
annotateVideoOperationCallable() {
Expand All @@ -215,6 +275,25 @@ public final OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> annot
* (results).
*
* <p>Sample code:
*
* <pre>{@code
* try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* AnnotateVideoRequest request =
* AnnotateVideoRequest.newBuilder()
* .setInputUri("inputUri470706498")
* .setInputContent(ByteString.EMPTY)
* .addAllFeatures(new ArrayList<Feature>())
* .setVideoContext(VideoContext.newBuilder().build())
* .setOutputUri("outputUri-2119300949")
* .setLocationId("locationId1541836720")
* .build();
* ApiFuture<Operation> future =
* videoIntelligenceServiceClient.annotateVideoCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<AnnotateVideoRequest, Operation> annotateVideoCallable() {
return stub.annotateVideoCallable();
Expand Down
Expand Up @@ -22,6 +22,16 @@
* <p>Service Description: Service that implements the Video Intelligence API.
*
* <p>Sample for VideoIntelligenceServiceClient:
*
* <pre>{@code
* try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* String inputUri = "inputUri470706498";
* List<Feature> features = new ArrayList<>();
* AnnotateVideoResponse response =
* videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
* }
* }</pre>
*/
@Generated("by gapic-generator-java")
package com.google.cloud.videointelligence.v1;
Expand Down
Expand Up @@ -37,6 +37,16 @@
* <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 (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* String inputUri = "inputUri470706498";
* List<Feature> features = new ArrayList<>();
* AnnotateVideoResponse response =
* videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
* }
* }</pre>
*
* <p>Note: close() needs to be called on the VideoIntelligenceServiceClient 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 @@ -160,6 +170,18 @@ public final OperationsClient getOperationsClient() {
* `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse`
* (results).
*
* <p>Sample code:
*
* <pre>{@code
* try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* String inputUri = "inputUri470706498";
* List<Feature> features = new ArrayList<>();
* AnnotateVideoResponse response =
* videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
* }
* }</pre>
*
* @param inputUri Input video location. Currently, only [Google Cloud
* Storage](https://cloud.google.com/storage/) URIs are supported, which must be specified in
* the following format: `gs://bucket-id/object-id` (other URI formats return
Expand All @@ -186,6 +208,25 @@ public final OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> annot
* `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse`
* (results).
*
* <p>Sample code:
*
* <pre>{@code
* try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* AnnotateVideoRequest request =
* AnnotateVideoRequest.newBuilder()
* .setInputUri("inputUri470706498")
* .setInputContent(ByteString.EMPTY)
* .addAllFeatures(new ArrayList<Feature>())
* .setVideoContext(VideoContext.newBuilder().build())
* .setOutputUri("outputUri-2119300949")
* .setLocationId("locationId1541836720")
* .build();
* AnnotateVideoResponse response =
* videoIntelligenceServiceClient.annotateVideoAsync(request).get();
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand All @@ -202,6 +243,25 @@ public final OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> annot
* (results).
*
* <p>Sample code:
*
* <pre>{@code
* try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* AnnotateVideoRequest request =
* AnnotateVideoRequest.newBuilder()
* .setInputUri("inputUri470706498")
* .setInputContent(ByteString.EMPTY)
* .addAllFeatures(new ArrayList<Feature>())
* .setVideoContext(VideoContext.newBuilder().build())
* .setOutputUri("outputUri-2119300949")
* .setLocationId("locationId1541836720")
* .build();
* OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> future =
* videoIntelligenceServiceClient.annotateVideoOperationCallable().futureCall(request);
* // Do something.
* AnnotateVideoResponse response = future.get();
* }
* }</pre>
*/
public final OperationCallable<AnnotateVideoRequest, AnnotateVideoResponse, AnnotateVideoProgress>
annotateVideoOperationCallable() {
Expand All @@ -216,6 +276,25 @@ public final OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> annot
* (results).
*
* <p>Sample code:
*
* <pre>{@code
* try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* AnnotateVideoRequest request =
* AnnotateVideoRequest.newBuilder()
* .setInputUri("inputUri470706498")
* .setInputContent(ByteString.EMPTY)
* .addAllFeatures(new ArrayList<Feature>())
* .setVideoContext(VideoContext.newBuilder().build())
* .setOutputUri("outputUri-2119300949")
* .setLocationId("locationId1541836720")
* .build();
* ApiFuture<Operation> future =
* videoIntelligenceServiceClient.annotateVideoCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<AnnotateVideoRequest, Operation> annotateVideoCallable() {
return stub.annotateVideoCallable();
Expand Down
Expand Up @@ -22,6 +22,16 @@
* <p>Service Description: Service that implements Google Cloud Video Intelligence API.
*
* <p>Sample for VideoIntelligenceServiceClient:
*
* <pre>{@code
* try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* String inputUri = "inputUri470706498";
* List<Feature> features = new ArrayList<>();
* AnnotateVideoResponse response =
* videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
* }
* }</pre>
*/
@Generated("by gapic-generator-java")
package com.google.cloud.videointelligence.v1beta2;
Expand Down
Expand Up @@ -37,6 +37,16 @@
* <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 (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* String inputUri = "inputUri470706498";
* List<Feature> features = new ArrayList<>();
* AnnotateVideoResponse response =
* videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
* }
* }</pre>
*
* <p>Note: close() needs to be called on the VideoIntelligenceServiceClient 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 @@ -160,6 +170,18 @@ public final OperationsClient getOperationsClient() {
* `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse`
* (results).
*
* <p>Sample code:
*
* <pre>{@code
* try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* String inputUri = "inputUri470706498";
* List<Feature> features = new ArrayList<>();
* AnnotateVideoResponse response =
* videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
* }
* }</pre>
*
* @param inputUri Input video location. Currently, only [Google Cloud
* Storage](https://cloud.google.com/storage/) URIs are supported, which must be specified in
* the following format: `gs://bucket-id/object-id` (other URI formats return
Expand All @@ -186,6 +208,25 @@ public final OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> annot
* `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse`
* (results).
*
* <p>Sample code:
*
* <pre>{@code
* try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* AnnotateVideoRequest request =
* AnnotateVideoRequest.newBuilder()
* .setInputUri("inputUri470706498")
* .setInputContent(ByteString.EMPTY)
* .addAllFeatures(new ArrayList<Feature>())
* .setVideoContext(VideoContext.newBuilder().build())
* .setOutputUri("outputUri-2119300949")
* .setLocationId("locationId1541836720")
* .build();
* AnnotateVideoResponse response =
* videoIntelligenceServiceClient.annotateVideoAsync(request).get();
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand All @@ -202,6 +243,25 @@ public final OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> annot
* (results).
*
* <p>Sample code:
*
* <pre>{@code
* try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* AnnotateVideoRequest request =
* AnnotateVideoRequest.newBuilder()
* .setInputUri("inputUri470706498")
* .setInputContent(ByteString.EMPTY)
* .addAllFeatures(new ArrayList<Feature>())
* .setVideoContext(VideoContext.newBuilder().build())
* .setOutputUri("outputUri-2119300949")
* .setLocationId("locationId1541836720")
* .build();
* OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> future =
* videoIntelligenceServiceClient.annotateVideoOperationCallable().futureCall(request);
* // Do something.
* AnnotateVideoResponse response = future.get();
* }
* }</pre>
*/
public final OperationCallable<AnnotateVideoRequest, AnnotateVideoResponse, AnnotateVideoProgress>
annotateVideoOperationCallable() {
Expand All @@ -216,6 +276,25 @@ public final OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> annot
* (results).
*
* <p>Sample code:
*
* <pre>{@code
* try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* AnnotateVideoRequest request =
* AnnotateVideoRequest.newBuilder()
* .setInputUri("inputUri470706498")
* .setInputContent(ByteString.EMPTY)
* .addAllFeatures(new ArrayList<Feature>())
* .setVideoContext(VideoContext.newBuilder().build())
* .setOutputUri("outputUri-2119300949")
* .setLocationId("locationId1541836720")
* .build();
* ApiFuture<Operation> future =
* videoIntelligenceServiceClient.annotateVideoCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<AnnotateVideoRequest, Operation> annotateVideoCallable() {
return stub.annotateVideoCallable();
Expand Down
Expand Up @@ -22,6 +22,16 @@
* <p>Service Description: Service that implements Google Cloud Video Intelligence API.
*
* <p>Sample for VideoIntelligenceServiceClient:
*
* <pre>{@code
* try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
* VideoIntelligenceServiceClient.create()) {
* String inputUri = "inputUri470706498";
* List<Feature> features = new ArrayList<>();
* AnnotateVideoResponse response =
* videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
* }
* }</pre>
*/
@Generated("by gapic-generator-java")
package com.google.cloud.videointelligence.v1p1beta1;
Expand Down

0 comments on commit b725c3a

Please sign in to comment.