From 7a71c6db007a6e6bf5037dd13522ba8b7fc7a2ba Mon Sep 17 00:00:00 2001 From: Gus Class Date: Wed, 12 Jul 2017 13:13:53 -0700 Subject: [PATCH] samples: Upgrades client to 0.20.1 and addresses changes to long running operations --- video/src/main/java/com/example/video/Detect.java | 11 ++++++----- .../main/java/com/example/video/QuickstartSample.java | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/video/src/main/java/com/example/video/Detect.java b/video/src/main/java/com/example/video/Detect.java index 3c11c01cff2..3dd6e3d5aa6 100644 --- a/video/src/main/java/com/example/video/Detect.java +++ b/video/src/main/java/com/example/video/Detect.java @@ -17,6 +17,7 @@ package com.example.video; import com.google.api.gax.grpc.OperationFuture; +import com.google.cloud.videointelligence.v1beta1.AnnotateVideoProgress; import com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest; import com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse; import com.google.cloud.videointelligence.v1beta1.FaceAnnotation; @@ -111,7 +112,7 @@ public static void analyzeFaces(String gcsUri) throws ExecutionException, .addFeatures(Feature.FACE_DETECTION) .build(); - OperationFuture operation = + OperationFuture operation = client.annotateVideoAsync(request); System.out.println("Waiting for operation to complete..."); @@ -151,7 +152,7 @@ public static void analyzeLabels(String gcsUri) throws .addFeatures(Feature.LABEL_DETECTION) .build(); - OperationFuture operation = + OperationFuture operation = client.annotateVideoAsync(request); System.out.println("Waiting for operation to complete..."); @@ -199,7 +200,7 @@ public static void analyzeLabelsFile(String filePath) throws .addFeatures(Feature.LABEL_DETECTION) .build(); - OperationFuture operation = + OperationFuture operation = client.annotateVideoAsync(request); System.out.println("Waiting for operation to complete..."); @@ -244,7 +245,7 @@ public static void analyzeShots(String gcsUri) .addFeatures(Feature.SHOT_CHANGE_DETECTION) .build(); - OperationFuture operation = + OperationFuture operation = client.annotateVideoAsync(request); System.out.println("Waiting for operation to complete..."); @@ -284,7 +285,7 @@ public static void analyzeSafeSearch(String gcsUri) .addFeatures(Feature.SAFE_SEARCH_DETECTION) .build(); - OperationFuture operation = + OperationFuture operation = client.annotateVideoAsync(request); System.out.println("Waiting for operation to complete..."); diff --git a/video/src/main/java/com/example/video/QuickstartSample.java b/video/src/main/java/com/example/video/QuickstartSample.java index f2958fc503c..3b4b0dc376b 100644 --- a/video/src/main/java/com/example/video/QuickstartSample.java +++ b/video/src/main/java/com/example/video/QuickstartSample.java @@ -18,6 +18,7 @@ // [START videointelligence_quickstart] import com.google.api.gax.grpc.OperationFuture; +import com.google.cloud.videointelligence.v1beta1.AnnotateVideoProgress; import com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest; import com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse; import com.google.cloud.videointelligence.v1beta1.Feature; @@ -48,7 +49,7 @@ public static void main(String[] args) throws .addFeatures(Feature.LABEL_DETECTION) .build(); - OperationFuture operation = + OperationFuture operation = client.annotateVideoAsync(request); System.out.println("Waiting for operation to complete...");