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

docs: generate sample code in the Java microgenerator #395

Merged
merged 2 commits into from Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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