From b725c3aad40c194567877ad6fbb0cf12a61a3c50 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 16 Feb 2021 09:46:05 -0800 Subject: [PATCH] docs: generate sample code in the Java microgenerator (#395) This PR was generated using Autosynth. :rainbow: 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: https://github.com/googleapis/googleapis/commit/8d8c008e56f1af31d57f75561e0f1848ffb29eeb --- .../v1/VideoIntelligenceServiceClient.java | 79 +++++++++++++++++++ .../videointelligence/v1/package-info.java | 10 +++ .../VideoIntelligenceServiceClient.java | 79 +++++++++++++++++++ .../v1beta2/package-info.java | 10 +++ .../VideoIntelligenceServiceClient.java | 79 +++++++++++++++++++ .../v1p1beta1/package-info.java | 10 +++ .../VideoIntelligenceServiceClient.java | 79 +++++++++++++++++++ .../v1p2beta1/package-info.java | 10 +++ ...reamingVideoIntelligenceServiceClient.java | 26 ++++++ .../VideoIntelligenceServiceClient.java | 79 +++++++++++++++++++ .../v1p3beta1/package-info.java | 23 ++++++ .../src/main/java/video/DetectPerson.java | 3 +- .../src/main/java/video/DetectPersonGcs.java | 3 +- synth.metadata | 4 +- 14 files changed, 490 insertions(+), 4 deletions(-) diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/VideoIntelligenceServiceClient.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/VideoIntelligenceServiceClient.java index 6ae521cbd..1a7e01f21 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/VideoIntelligenceServiceClient.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/VideoIntelligenceServiceClient.java @@ -37,6 +37,16 @@ *

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: * + *

{@code
+ * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+ *     VideoIntelligenceServiceClient.create()) {
+ *   String inputUri = "inputUri470706498";
+ *   List features = new ArrayList<>();
+ *   AnnotateVideoResponse response =
+ *       videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+ * }
+ * }
+ * *

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(). @@ -159,6 +169,18 @@ public final OperationsClient getOperationsClient() { * `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` * (results). * + *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   String inputUri = "inputUri470706498";
+   *   List features = new ArrayList<>();
+   *   AnnotateVideoResponse response =
+   *       videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+   * }
+   * }
+ * * @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 @@ -185,6 +207,25 @@ public final OperationFuture annot * `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` * (results). * + *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   AnnotateVideoRequest request =
+   *       AnnotateVideoRequest.newBuilder()
+   *           .setInputUri("inputUri470706498")
+   *           .setInputContent(ByteString.EMPTY)
+   *           .addAllFeatures(new ArrayList())
+   *           .setVideoContext(VideoContext.newBuilder().build())
+   *           .setOutputUri("outputUri-2119300949")
+   *           .setLocationId("locationId1541836720")
+   *           .build();
+   *   AnnotateVideoResponse response =
+   *       videoIntelligenceServiceClient.annotateVideoAsync(request).get();
+   * }
+   * }
+ * * @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 */ @@ -201,6 +242,25 @@ public final OperationFuture annot * (results). * *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   AnnotateVideoRequest request =
+   *       AnnotateVideoRequest.newBuilder()
+   *           .setInputUri("inputUri470706498")
+   *           .setInputContent(ByteString.EMPTY)
+   *           .addAllFeatures(new ArrayList())
+   *           .setVideoContext(VideoContext.newBuilder().build())
+   *           .setOutputUri("outputUri-2119300949")
+   *           .setLocationId("locationId1541836720")
+   *           .build();
+   *   OperationFuture future =
+   *       videoIntelligenceServiceClient.annotateVideoOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AnnotateVideoResponse response = future.get();
+   * }
+   * }
*/ public final OperationCallable annotateVideoOperationCallable() { @@ -215,6 +275,25 @@ public final OperationFuture annot * (results). * *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   AnnotateVideoRequest request =
+   *       AnnotateVideoRequest.newBuilder()
+   *           .setInputUri("inputUri470706498")
+   *           .setInputContent(ByteString.EMPTY)
+   *           .addAllFeatures(new ArrayList())
+   *           .setVideoContext(VideoContext.newBuilder().build())
+   *           .setOutputUri("outputUri-2119300949")
+   *           .setLocationId("locationId1541836720")
+   *           .build();
+   *   ApiFuture future =
+   *       videoIntelligenceServiceClient.annotateVideoCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable annotateVideoCallable() { return stub.annotateVideoCallable(); diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/package-info.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/package-info.java index c32b1e03e..eaa6fd916 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/package-info.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/package-info.java @@ -22,6 +22,16 @@ *

Service Description: Service that implements the Video Intelligence API. * *

Sample for VideoIntelligenceServiceClient: + * + *

{@code
+ * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+ *     VideoIntelligenceServiceClient.create()) {
+ *   String inputUri = "inputUri470706498";
+ *   List features = new ArrayList<>();
+ *   AnnotateVideoResponse response =
+ *       videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.videointelligence.v1; diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1beta2/VideoIntelligenceServiceClient.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1beta2/VideoIntelligenceServiceClient.java index 5eeafab4e..c584e784c 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1beta2/VideoIntelligenceServiceClient.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1beta2/VideoIntelligenceServiceClient.java @@ -37,6 +37,16 @@ *

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: * + *

{@code
+ * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+ *     VideoIntelligenceServiceClient.create()) {
+ *   String inputUri = "inputUri470706498";
+ *   List features = new ArrayList<>();
+ *   AnnotateVideoResponse response =
+ *       videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+ * }
+ * }
+ * *

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(). @@ -160,6 +170,18 @@ public final OperationsClient getOperationsClient() { * `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` * (results). * + *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   String inputUri = "inputUri470706498";
+   *   List features = new ArrayList<>();
+   *   AnnotateVideoResponse response =
+   *       videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+   * }
+   * }
+ * * @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 @@ -186,6 +208,25 @@ public final OperationFuture annot * `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` * (results). * + *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   AnnotateVideoRequest request =
+   *       AnnotateVideoRequest.newBuilder()
+   *           .setInputUri("inputUri470706498")
+   *           .setInputContent(ByteString.EMPTY)
+   *           .addAllFeatures(new ArrayList())
+   *           .setVideoContext(VideoContext.newBuilder().build())
+   *           .setOutputUri("outputUri-2119300949")
+   *           .setLocationId("locationId1541836720")
+   *           .build();
+   *   AnnotateVideoResponse response =
+   *       videoIntelligenceServiceClient.annotateVideoAsync(request).get();
+   * }
+   * }
+ * * @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 */ @@ -202,6 +243,25 @@ public final OperationFuture annot * (results). * *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   AnnotateVideoRequest request =
+   *       AnnotateVideoRequest.newBuilder()
+   *           .setInputUri("inputUri470706498")
+   *           .setInputContent(ByteString.EMPTY)
+   *           .addAllFeatures(new ArrayList())
+   *           .setVideoContext(VideoContext.newBuilder().build())
+   *           .setOutputUri("outputUri-2119300949")
+   *           .setLocationId("locationId1541836720")
+   *           .build();
+   *   OperationFuture future =
+   *       videoIntelligenceServiceClient.annotateVideoOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AnnotateVideoResponse response = future.get();
+   * }
+   * }
*/ public final OperationCallable annotateVideoOperationCallable() { @@ -216,6 +276,25 @@ public final OperationFuture annot * (results). * *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   AnnotateVideoRequest request =
+   *       AnnotateVideoRequest.newBuilder()
+   *           .setInputUri("inputUri470706498")
+   *           .setInputContent(ByteString.EMPTY)
+   *           .addAllFeatures(new ArrayList())
+   *           .setVideoContext(VideoContext.newBuilder().build())
+   *           .setOutputUri("outputUri-2119300949")
+   *           .setLocationId("locationId1541836720")
+   *           .build();
+   *   ApiFuture future =
+   *       videoIntelligenceServiceClient.annotateVideoCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable annotateVideoCallable() { return stub.annotateVideoCallable(); diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1beta2/package-info.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1beta2/package-info.java index d3b476037..cd7727840 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1beta2/package-info.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1beta2/package-info.java @@ -22,6 +22,16 @@ *

Service Description: Service that implements Google Cloud Video Intelligence API. * *

Sample for VideoIntelligenceServiceClient: + * + *

{@code
+ * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+ *     VideoIntelligenceServiceClient.create()) {
+ *   String inputUri = "inputUri470706498";
+ *   List features = new ArrayList<>();
+ *   AnnotateVideoResponse response =
+ *       videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.videointelligence.v1beta2; diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p1beta1/VideoIntelligenceServiceClient.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p1beta1/VideoIntelligenceServiceClient.java index 1ebdffa27..804943d90 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p1beta1/VideoIntelligenceServiceClient.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p1beta1/VideoIntelligenceServiceClient.java @@ -37,6 +37,16 @@ *

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: * + *

{@code
+ * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+ *     VideoIntelligenceServiceClient.create()) {
+ *   String inputUri = "inputUri470706498";
+ *   List features = new ArrayList<>();
+ *   AnnotateVideoResponse response =
+ *       videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+ * }
+ * }
+ * *

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(). @@ -160,6 +170,18 @@ public final OperationsClient getOperationsClient() { * `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` * (results). * + *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   String inputUri = "inputUri470706498";
+   *   List features = new ArrayList<>();
+   *   AnnotateVideoResponse response =
+   *       videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+   * }
+   * }
+ * * @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 @@ -186,6 +208,25 @@ public final OperationFuture annot * `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` * (results). * + *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   AnnotateVideoRequest request =
+   *       AnnotateVideoRequest.newBuilder()
+   *           .setInputUri("inputUri470706498")
+   *           .setInputContent(ByteString.EMPTY)
+   *           .addAllFeatures(new ArrayList())
+   *           .setVideoContext(VideoContext.newBuilder().build())
+   *           .setOutputUri("outputUri-2119300949")
+   *           .setLocationId("locationId1541836720")
+   *           .build();
+   *   AnnotateVideoResponse response =
+   *       videoIntelligenceServiceClient.annotateVideoAsync(request).get();
+   * }
+   * }
+ * * @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 */ @@ -202,6 +243,25 @@ public final OperationFuture annot * (results). * *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   AnnotateVideoRequest request =
+   *       AnnotateVideoRequest.newBuilder()
+   *           .setInputUri("inputUri470706498")
+   *           .setInputContent(ByteString.EMPTY)
+   *           .addAllFeatures(new ArrayList())
+   *           .setVideoContext(VideoContext.newBuilder().build())
+   *           .setOutputUri("outputUri-2119300949")
+   *           .setLocationId("locationId1541836720")
+   *           .build();
+   *   OperationFuture future =
+   *       videoIntelligenceServiceClient.annotateVideoOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AnnotateVideoResponse response = future.get();
+   * }
+   * }
*/ public final OperationCallable annotateVideoOperationCallable() { @@ -216,6 +276,25 @@ public final OperationFuture annot * (results). * *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   AnnotateVideoRequest request =
+   *       AnnotateVideoRequest.newBuilder()
+   *           .setInputUri("inputUri470706498")
+   *           .setInputContent(ByteString.EMPTY)
+   *           .addAllFeatures(new ArrayList())
+   *           .setVideoContext(VideoContext.newBuilder().build())
+   *           .setOutputUri("outputUri-2119300949")
+   *           .setLocationId("locationId1541836720")
+   *           .build();
+   *   ApiFuture future =
+   *       videoIntelligenceServiceClient.annotateVideoCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable annotateVideoCallable() { return stub.annotateVideoCallable(); diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p1beta1/package-info.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p1beta1/package-info.java index 14f3ab23d..2d863d339 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p1beta1/package-info.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p1beta1/package-info.java @@ -22,6 +22,16 @@ *

Service Description: Service that implements Google Cloud Video Intelligence API. * *

Sample for VideoIntelligenceServiceClient: + * + *

{@code
+ * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+ *     VideoIntelligenceServiceClient.create()) {
+ *   String inputUri = "inputUri470706498";
+ *   List features = new ArrayList<>();
+ *   AnnotateVideoResponse response =
+ *       videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.videointelligence.v1p1beta1; diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceClient.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceClient.java index 26c93b04f..ef840faab 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceClient.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceClient.java @@ -37,6 +37,16 @@ *

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: * + *

{@code
+ * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+ *     VideoIntelligenceServiceClient.create()) {
+ *   String inputUri = "inputUri470706498";
+ *   List features = new ArrayList<>();
+ *   AnnotateVideoResponse response =
+ *       videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+ * }
+ * }
+ * *

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(). @@ -160,6 +170,18 @@ public final OperationsClient getOperationsClient() { * `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` * (results). * + *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   String inputUri = "inputUri470706498";
+   *   List features = new ArrayList<>();
+   *   AnnotateVideoResponse response =
+   *       videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+   * }
+   * }
+ * * @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 @@ -186,6 +208,25 @@ public final OperationFuture annot * `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` * (results). * + *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   AnnotateVideoRequest request =
+   *       AnnotateVideoRequest.newBuilder()
+   *           .setInputUri("inputUri470706498")
+   *           .setInputContent(ByteString.EMPTY)
+   *           .addAllFeatures(new ArrayList())
+   *           .setVideoContext(VideoContext.newBuilder().build())
+   *           .setOutputUri("outputUri-2119300949")
+   *           .setLocationId("locationId1541836720")
+   *           .build();
+   *   AnnotateVideoResponse response =
+   *       videoIntelligenceServiceClient.annotateVideoAsync(request).get();
+   * }
+   * }
+ * * @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 */ @@ -202,6 +243,25 @@ public final OperationFuture annot * (results). * *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   AnnotateVideoRequest request =
+   *       AnnotateVideoRequest.newBuilder()
+   *           .setInputUri("inputUri470706498")
+   *           .setInputContent(ByteString.EMPTY)
+   *           .addAllFeatures(new ArrayList())
+   *           .setVideoContext(VideoContext.newBuilder().build())
+   *           .setOutputUri("outputUri-2119300949")
+   *           .setLocationId("locationId1541836720")
+   *           .build();
+   *   OperationFuture future =
+   *       videoIntelligenceServiceClient.annotateVideoOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AnnotateVideoResponse response = future.get();
+   * }
+   * }
*/ public final OperationCallable annotateVideoOperationCallable() { @@ -216,6 +276,25 @@ public final OperationFuture annot * (results). * *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   AnnotateVideoRequest request =
+   *       AnnotateVideoRequest.newBuilder()
+   *           .setInputUri("inputUri470706498")
+   *           .setInputContent(ByteString.EMPTY)
+   *           .addAllFeatures(new ArrayList())
+   *           .setVideoContext(VideoContext.newBuilder().build())
+   *           .setOutputUri("outputUri-2119300949")
+   *           .setLocationId("locationId1541836720")
+   *           .build();
+   *   ApiFuture future =
+   *       videoIntelligenceServiceClient.annotateVideoCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable annotateVideoCallable() { return stub.annotateVideoCallable(); diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/package-info.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/package-info.java index e804cf48b..8335379b2 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/package-info.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/package-info.java @@ -22,6 +22,16 @@ *

Service Description: Service that implements Google Cloud Video Intelligence API. * *

Sample for VideoIntelligenceServiceClient: + * + *

{@code
+ * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+ *     VideoIntelligenceServiceClient.create()) {
+ *   String inputUri = "inputUri470706498";
+ *   List features = new ArrayList<>();
+ *   AnnotateVideoResponse response =
+ *       videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.videointelligence.v1p2beta1; diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/StreamingVideoIntelligenceServiceClient.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/StreamingVideoIntelligenceServiceClient.java index 453927438..dfe9eb321 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/StreamingVideoIntelligenceServiceClient.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/StreamingVideoIntelligenceServiceClient.java @@ -32,6 +32,19 @@ *

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: * + *

{@code
+ * try (StreamingVideoIntelligenceServiceClient streamingVideoIntelligenceServiceClient =
+ *     StreamingVideoIntelligenceServiceClient.create()) {
+ *   BidiStream bidiStream =
+ *       streamingVideoIntelligenceServiceClient.streamingAnnotateVideoCallable().call();
+ *   StreamingAnnotateVideoRequest request = StreamingAnnotateVideoRequest.newBuilder().build();
+ *   bidiStream.send(request);
+ *   for (StreamingAnnotateVideoResponse response : bidiStream) {
+ *     // Do something when a response is received.
+ *   }
+ * }
+ * }
+ * *

Note: close() needs to be called on the StreamingVideoIntelligenceServiceClient object to * clean up resources such as threads. In the example above, try-with-resources is used, which * automatically calls close(). @@ -146,6 +159,19 @@ public StreamingVideoIntelligenceServiceStub getStub() { * video/audio bytes. This method is only available via the gRPC API (not REST). * *

Sample code: + * + *

{@code
+   * try (StreamingVideoIntelligenceServiceClient streamingVideoIntelligenceServiceClient =
+   *     StreamingVideoIntelligenceServiceClient.create()) {
+   *   BidiStream bidiStream =
+   *       streamingVideoIntelligenceServiceClient.streamingAnnotateVideoCallable().call();
+   *   StreamingAnnotateVideoRequest request = StreamingAnnotateVideoRequest.newBuilder().build();
+   *   bidiStream.send(request);
+   *   for (StreamingAnnotateVideoResponse response : bidiStream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
*/ public final BidiStreamingCallable streamingAnnotateVideoCallable() { diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/VideoIntelligenceServiceClient.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/VideoIntelligenceServiceClient.java index 65ee0da4b..2efe58e01 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/VideoIntelligenceServiceClient.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/VideoIntelligenceServiceClient.java @@ -37,6 +37,16 @@ *

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: * + *

{@code
+ * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+ *     VideoIntelligenceServiceClient.create()) {
+ *   String inputUri = "inputUri470706498";
+ *   List features = new ArrayList<>();
+ *   AnnotateVideoResponse response =
+ *       videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+ * }
+ * }
+ * *

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(). @@ -160,6 +170,18 @@ public final OperationsClient getOperationsClient() { * `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` * (results). * + *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   String inputUri = "inputUri470706498";
+   *   List features = new ArrayList<>();
+   *   AnnotateVideoResponse response =
+   *       videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+   * }
+   * }
+ * * @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 @@ -186,6 +208,25 @@ public final OperationFuture annot * `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` * (results). * + *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   AnnotateVideoRequest request =
+   *       AnnotateVideoRequest.newBuilder()
+   *           .setInputUri("inputUri470706498")
+   *           .setInputContent(ByteString.EMPTY)
+   *           .addAllFeatures(new ArrayList())
+   *           .setVideoContext(VideoContext.newBuilder().build())
+   *           .setOutputUri("outputUri-2119300949")
+   *           .setLocationId("locationId1541836720")
+   *           .build();
+   *   AnnotateVideoResponse response =
+   *       videoIntelligenceServiceClient.annotateVideoAsync(request).get();
+   * }
+   * }
+ * * @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 */ @@ -202,6 +243,25 @@ public final OperationFuture annot * (results). * *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   AnnotateVideoRequest request =
+   *       AnnotateVideoRequest.newBuilder()
+   *           .setInputUri("inputUri470706498")
+   *           .setInputContent(ByteString.EMPTY)
+   *           .addAllFeatures(new ArrayList())
+   *           .setVideoContext(VideoContext.newBuilder().build())
+   *           .setOutputUri("outputUri-2119300949")
+   *           .setLocationId("locationId1541836720")
+   *           .build();
+   *   OperationFuture future =
+   *       videoIntelligenceServiceClient.annotateVideoOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AnnotateVideoResponse response = future.get();
+   * }
+   * }
*/ public final OperationCallable annotateVideoOperationCallable() { @@ -216,6 +276,25 @@ public final OperationFuture annot * (results). * *

Sample code: + * + *

{@code
+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+   *     VideoIntelligenceServiceClient.create()) {
+   *   AnnotateVideoRequest request =
+   *       AnnotateVideoRequest.newBuilder()
+   *           .setInputUri("inputUri470706498")
+   *           .setInputContent(ByteString.EMPTY)
+   *           .addAllFeatures(new ArrayList())
+   *           .setVideoContext(VideoContext.newBuilder().build())
+   *           .setOutputUri("outputUri-2119300949")
+   *           .setLocationId("locationId1541836720")
+   *           .build();
+   *   ApiFuture future =
+   *       videoIntelligenceServiceClient.annotateVideoCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable annotateVideoCallable() { return stub.annotateVideoCallable(); diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/package-info.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/package-info.java index 435ce2c26..f5fa4f98a 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/package-info.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/package-info.java @@ -23,11 +23,34 @@ * *

Sample for VideoIntelligenceServiceClient: * + *

{@code
+ * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+ *     VideoIntelligenceServiceClient.create()) {
+ *   String inputUri = "inputUri470706498";
+ *   List features = new ArrayList<>();
+ *   AnnotateVideoResponse response =
+ *       videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+ * }
+ * }
+ * *

======================= StreamingVideoIntelligenceServiceClient ======================= * *

Service Description: Service that implements streaming Video Intelligence API. * *

Sample for StreamingVideoIntelligenceServiceClient: + * + *

{@code
+ * try (StreamingVideoIntelligenceServiceClient streamingVideoIntelligenceServiceClient =
+ *     StreamingVideoIntelligenceServiceClient.create()) {
+ *   BidiStream bidiStream =
+ *       streamingVideoIntelligenceServiceClient.streamingAnnotateVideoCallable().call();
+ *   StreamingAnnotateVideoRequest request = StreamingAnnotateVideoRequest.newBuilder().build();
+ *   bidiStream.send(request);
+ *   for (StreamingAnnotateVideoResponse response : bidiStream) {
+ *     // Do something when a response is received.
+ *   }
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.videointelligence.v1p3beta1; diff --git a/samples/snippets/src/main/java/video/DetectPerson.java b/samples/snippets/src/main/java/video/DetectPerson.java index 66ce6409c..29653db79 100644 --- a/samples/snippets/src/main/java/video/DetectPerson.java +++ b/samples/snippets/src/main/java/video/DetectPerson.java @@ -101,7 +101,8 @@ public static void detectPerson(String localFilePath) throws Exception { // posture of the person detected. TimestampedObject firstTimestampedObject = track.getTimestampedObjects(0); - // Attributes include unique pieces of clothing, poses (i.e., body landmarks) of the person detected. + // Attributes include unique pieces of clothing, poses (i.e., body landmarks) + // of the person detected. for (DetectedAttribute attribute : firstTimestampedObject.getAttributesList()) { System.out.printf( "\tAttribute: %s; Value: %s\n", attribute.getName(), attribute.getValue()); diff --git a/samples/snippets/src/main/java/video/DetectPersonGcs.java b/samples/snippets/src/main/java/video/DetectPersonGcs.java index 4525604b5..df4fdd078 100644 --- a/samples/snippets/src/main/java/video/DetectPersonGcs.java +++ b/samples/snippets/src/main/java/video/DetectPersonGcs.java @@ -93,7 +93,8 @@ public static void detectPersonGcs(String gcsUri) throws Exception { // posture of the person detected. TimestampedObject firstTimestampedObject = track.getTimestampedObjects(0); - // Attributes include unique pieces of clothing, poses (i.e., body landmarks) of the person detected. + // Attributes include unique pieces of clothing, poses (i.e., body landmarks) + // of the person detected. for (DetectedAttribute attribute : firstTimestampedObject.getAttributesList()) { System.out.printf( "\tAttribute: %s; Value: %s\n", attribute.getName(), attribute.getValue()); diff --git a/synth.metadata b/synth.metadata index 168470e5c..719d39d01 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,8 +11,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, {