From 912d332be8e0a363ab6df37f070897dae8bed1cc Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 23 Jun 2022 17:21:51 -0400 Subject: [PATCH] feat: Enable REST transport for most of Java and Go clients (#920) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Enable REST transport for most of Java and Go clients PiperOrigin-RevId: 456641589 Source-Link: https://github.com/googleapis/googleapis/commit/8a251f5225b789b2383207ffd978f6aa3d77fcf7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4ca52a529cf01308d9714950edffbea3560cfbdb Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGNhNTJhNTI5Y2YwMTMwOGQ5NzE0OTUwZWRmZmJlYTM1NjBjZmJkYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * deps: adding gax-httpjson Co-authored-by: Owl Bot Co-authored-by: Tomo Suzuki --- .../annotatevideo/SyncAnnotateVideo.java | 47 +++++++++++++++ .../annotatevideo/AsyncAnnotateVideo.java | 56 ++++++++++++++++++ .../annotatevideo/AsyncAnnotateVideoLRO.java | 57 ++++++++++++++++++ .../annotatevideo/SyncAnnotateVideo.java | 53 +++++++++++++++++ .../SyncAnnotateVideoStringListfeature.java | 46 +++++++++++++++ .../SyncCreateSetCredentialsProvider.java | 44 ++++++++++++++ .../SyncCreateSetCredentialsProvider1.java | 43 ++++++++++++++ .../create/SyncCreateSetEndpoint.java | 39 ++++++++++++ .../annotatevideo/SyncAnnotateVideo.java | 47 +++++++++++++++ .../annotatevideo/SyncAnnotateVideo.java | 48 +++++++++++++++ .../annotatevideo/AsyncAnnotateVideo.java | 56 ++++++++++++++++++ .../annotatevideo/AsyncAnnotateVideoLRO.java | 58 ++++++++++++++++++ .../annotatevideo/SyncAnnotateVideo.java | 53 +++++++++++++++++ .../SyncAnnotateVideoStringListfeature.java | 46 +++++++++++++++ .../SyncCreateSetCredentialsProvider.java | 44 ++++++++++++++ .../SyncCreateSetCredentialsProvider1.java | 43 ++++++++++++++ .../create/SyncCreateSetEndpoint.java | 40 +++++++++++++ .../annotatevideo/SyncAnnotateVideo.java | 47 +++++++++++++++ .../annotatevideo/SyncAnnotateVideo.java | 49 +++++++++++++++ .../annotatevideo/AsyncAnnotateVideo.java | 56 ++++++++++++++++++ .../annotatevideo/AsyncAnnotateVideoLRO.java | 59 +++++++++++++++++++ .../annotatevideo/SyncAnnotateVideo.java | 53 +++++++++++++++++ .../SyncAnnotateVideoStringListfeature.java | 46 +++++++++++++++ .../SyncCreateSetCredentialsProvider.java | 44 ++++++++++++++ .../SyncCreateSetCredentialsProvider1.java | 43 ++++++++++++++ .../create/SyncCreateSetEndpoint.java | 41 +++++++++++++ .../annotatevideo/SyncAnnotateVideo.java | 47 +++++++++++++++ .../annotatevideo/SyncAnnotateVideo.java | 49 +++++++++++++++ .../annotatevideo/AsyncAnnotateVideo.java | 56 ++++++++++++++++++ .../annotatevideo/AsyncAnnotateVideoLRO.java | 59 +++++++++++++++++++ .../annotatevideo/SyncAnnotateVideo.java | 53 +++++++++++++++++ .../SyncAnnotateVideoStringListfeature.java | 46 +++++++++++++++ .../SyncCreateSetCredentialsProvider.java | 44 ++++++++++++++ .../SyncCreateSetCredentialsProvider1.java | 43 ++++++++++++++ .../create/SyncCreateSetEndpoint.java | 41 +++++++++++++ .../annotatevideo/SyncAnnotateVideo.java | 47 +++++++++++++++ .../SyncCreateSetCredentialsProvider.java | 44 ++++++++++++++ .../SyncCreateSetCredentialsProvider1.java | 44 ++++++++++++++ .../create/SyncCreateSetEndpoint.java | 41 +++++++++++++ .../AsyncStreamingAnnotateVideo.java | 48 +++++++++++++++ .../SyncStreamingAnnotateVideo.java | 50 ++++++++++++++++ .../SyncStreamingAnnotateVideo.java | 50 ++++++++++++++++ .../annotatevideo/SyncAnnotateVideo.java | 49 +++++++++++++++ .../annotatevideo/AsyncAnnotateVideo.java | 56 ++++++++++++++++++ .../annotatevideo/AsyncAnnotateVideoLRO.java | 59 +++++++++++++++++++ .../annotatevideo/SyncAnnotateVideo.java | 53 +++++++++++++++++ .../SyncAnnotateVideoStringListfeature.java | 46 +++++++++++++++ .../SyncCreateSetCredentialsProvider.java | 44 ++++++++++++++ .../SyncCreateSetCredentialsProvider1.java | 43 ++++++++++++++ .../create/SyncCreateSetEndpoint.java | 41 +++++++++++++ .../annotatevideo/SyncAnnotateVideo.java | 47 +++++++++++++++ 51 files changed, 2458 insertions(+) create mode 100644 video/generated/com/google/cloud/videointelligence/v1/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1beta2/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p1beta1/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p2beta1/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceserviceclient/create/SyncCreateSetEndpoint.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceserviceclient/streamingannotatevideo/AsyncStreamingAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceservicesettings/streamingannotatevideo/SyncStreamingAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p3beta1/stub/streamingvideointelligenceservicestubsettings/streamingannotatevideo/SyncStreamingAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p3beta1/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java create mode 100644 video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java diff --git a/video/generated/com/google/cloud/videointelligence/v1/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java new file mode 100644 index 00000000000..8c8d9a4de7d --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1.stub.samples; + +// [START videointelligence_v1_generated_videointelligenceservicestubsettings_annotatevideo_sync] +import com.google.cloud.videointelligence.v1.stub.VideoIntelligenceServiceStubSettings; +import java.time.Duration; + +public class SyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncAnnotateVideo(); + } + + public static void syncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceStubSettings.Builder videoIntelligenceServiceSettingsBuilder = + VideoIntelligenceServiceStubSettings.newBuilder(); + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .setRetrySettings( + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + VideoIntelligenceServiceStubSettings videoIntelligenceServiceSettings = + videoIntelligenceServiceSettingsBuilder.build(); + } +} +// [END videointelligence_v1_generated_videointelligenceservicestubsettings_annotatevideo_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java new file mode 100644 index 00000000000..e4cdf0bb043 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1.samples; + +// [START videointelligence_v1_generated_videointelligenceserviceclient_annotatevideo_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.videointelligence.v1.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1.Feature; +import com.google.cloud.videointelligence.v1.VideoContext; +import com.google.cloud.videointelligence.v1.VideoIntelligenceServiceClient; +import com.google.longrunning.Operation; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + asyncAnnotateVideo(); + } + + public static void asyncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + 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(); + } + } +} +// [END videointelligence_v1_generated_videointelligenceserviceclient_annotatevideo_async] diff --git a/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java b/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java new file mode 100644 index 00000000000..65f58d9f870 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java @@ -0,0 +1,57 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1.samples; + +// [START videointelligence_v1_generated_videointelligenceserviceclient_annotatevideo_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.videointelligence.v1.AnnotateVideoProgress; +import com.google.cloud.videointelligence.v1.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1.AnnotateVideoResponse; +import com.google.cloud.videointelligence.v1.Feature; +import com.google.cloud.videointelligence.v1.VideoContext; +import com.google.cloud.videointelligence.v1.VideoIntelligenceServiceClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncAnnotateVideoLRO { + + public static void main(String[] args) throws Exception { + asyncAnnotateVideoLRO(); + } + + public static void asyncAnnotateVideoLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + 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(); + } + } +} +// [END videointelligence_v1_generated_videointelligenceserviceclient_annotatevideo_lro_async] diff --git a/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java new file mode 100644 index 00000000000..b9566eedb12 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1.samples; + +// [START videointelligence_v1_generated_videointelligenceserviceclient_annotatevideo_sync] +import com.google.cloud.videointelligence.v1.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1.AnnotateVideoResponse; +import com.google.cloud.videointelligence.v1.Feature; +import com.google.cloud.videointelligence.v1.VideoContext; +import com.google.cloud.videointelligence.v1.VideoIntelligenceServiceClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class SyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncAnnotateVideo(); + } + + public static void syncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + 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(); + } + } +} +// [END videointelligence_v1_generated_videointelligenceserviceclient_annotatevideo_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java b/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java new file mode 100644 index 00000000000..65facc2025b --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1.samples; + +// [START +// videointelligence_v1_generated_videointelligenceserviceclient_annotatevideo_stringlistfeature_sync] +import com.google.cloud.videointelligence.v1.AnnotateVideoResponse; +import com.google.cloud.videointelligence.v1.Feature; +import com.google.cloud.videointelligence.v1.VideoIntelligenceServiceClient; +import java.util.ArrayList; +import java.util.List; + +public class SyncAnnotateVideoStringListfeature { + + public static void main(String[] args) throws Exception { + syncAnnotateVideoStringListfeature(); + } + + public static void syncAnnotateVideoStringListfeature() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create()) { + String inputUri = "inputUri470706498"; + List features = new ArrayList<>(); + AnnotateVideoResponse response = + videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get(); + } + } +} +// [END +// videointelligence_v1_generated_videointelligenceserviceclient_annotatevideo_stringlistfeature_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java b/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 00000000000..724680f3a39 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1.samples; + +// [START +// videointelligence_v1_generated_videointelligenceserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.videointelligence.v1.VideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1.VideoIntelligenceServiceSettings; +import com.google.cloud.videointelligence.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + VideoIntelligenceServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings); + } +} +// [END +// videointelligence_v1_generated_videointelligenceserviceclient_create_setcredentialsprovider_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java b/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 00000000000..1490a6db89f --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1.samples; + +// [START +// videointelligence_v1_generated_videointelligenceserviceclient_create_setcredentialsprovider1_sync] +import com.google.cloud.videointelligence.v1.VideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1.VideoIntelligenceServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + VideoIntelligenceServiceSettings.newBuilder() + .setTransportChannelProvider( + VideoIntelligenceServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings); + } +} +// [END +// videointelligence_v1_generated_videointelligenceserviceclient_create_setcredentialsprovider1_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java b/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 00000000000..9db516e9d0f --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1.samples; + +// [START videointelligence_v1_generated_videointelligenceserviceclient_create_setendpoint_sync] +import com.google.cloud.videointelligence.v1.VideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1.VideoIntelligenceServiceSettings; +import com.google.cloud.videointelligence.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + VideoIntelligenceServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings); + } +} +// [END videointelligence_v1_generated_videointelligenceserviceclient_create_setendpoint_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java new file mode 100644 index 00000000000..30b9aa63ebf --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1.samples; + +// [START videointelligence_v1_generated_videointelligenceservicesettings_annotatevideo_sync] +import com.google.cloud.videointelligence.v1.VideoIntelligenceServiceSettings; +import java.time.Duration; + +public class SyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncAnnotateVideo(); + } + + public static void syncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings.Builder videoIntelligenceServiceSettingsBuilder = + VideoIntelligenceServiceSettings.newBuilder(); + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .setRetrySettings( + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + videoIntelligenceServiceSettingsBuilder.build(); + } +} +// [END videointelligence_v1_generated_videointelligenceservicesettings_annotatevideo_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1beta2/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1beta2/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java new file mode 100644 index 00000000000..ab4d64f5921 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1beta2/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1beta2.stub.samples; + +// [START +// videointelligence_v1beta2_generated_videointelligenceservicestubsettings_annotatevideo_sync] +import com.google.cloud.videointelligence.v1beta2.stub.VideoIntelligenceServiceStubSettings; +import java.time.Duration; + +public class SyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncAnnotateVideo(); + } + + public static void syncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceStubSettings.Builder videoIntelligenceServiceSettingsBuilder = + VideoIntelligenceServiceStubSettings.newBuilder(); + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .setRetrySettings( + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + VideoIntelligenceServiceStubSettings videoIntelligenceServiceSettings = + videoIntelligenceServiceSettingsBuilder.build(); + } +} +// [END videointelligence_v1beta2_generated_videointelligenceservicestubsettings_annotatevideo_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java new file mode 100644 index 00000000000..065d030b90d --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1beta2.samples; + +// [START videointelligence_v1beta2_generated_videointelligenceserviceclient_annotatevideo_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.videointelligence.v1beta2.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1beta2.Feature; +import com.google.cloud.videointelligence.v1beta2.VideoContext; +import com.google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceClient; +import com.google.longrunning.Operation; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + asyncAnnotateVideo(); + } + + public static void asyncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + 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(); + } + } +} +// [END videointelligence_v1beta2_generated_videointelligenceserviceclient_annotatevideo_async] diff --git a/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java b/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java new file mode 100644 index 00000000000..dbdc031b897 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java @@ -0,0 +1,58 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1beta2.samples; + +// [START +// videointelligence_v1beta2_generated_videointelligenceserviceclient_annotatevideo_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.videointelligence.v1beta2.AnnotateVideoProgress; +import com.google.cloud.videointelligence.v1beta2.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1beta2.AnnotateVideoResponse; +import com.google.cloud.videointelligence.v1beta2.Feature; +import com.google.cloud.videointelligence.v1beta2.VideoContext; +import com.google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncAnnotateVideoLRO { + + public static void main(String[] args) throws Exception { + asyncAnnotateVideoLRO(); + } + + public static void asyncAnnotateVideoLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + 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(); + } + } +} +// [END videointelligence_v1beta2_generated_videointelligenceserviceclient_annotatevideo_lro_async] diff --git a/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java new file mode 100644 index 00000000000..a8fe3d154c7 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1beta2.samples; + +// [START videointelligence_v1beta2_generated_videointelligenceserviceclient_annotatevideo_sync] +import com.google.cloud.videointelligence.v1beta2.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1beta2.AnnotateVideoResponse; +import com.google.cloud.videointelligence.v1beta2.Feature; +import com.google.cloud.videointelligence.v1beta2.VideoContext; +import com.google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class SyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncAnnotateVideo(); + } + + public static void syncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + 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(); + } + } +} +// [END videointelligence_v1beta2_generated_videointelligenceserviceclient_annotatevideo_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java b/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java new file mode 100644 index 00000000000..5cb7e22d229 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1beta2.samples; + +// [START +// videointelligence_v1beta2_generated_videointelligenceserviceclient_annotatevideo_stringlistfeature_sync] +import com.google.cloud.videointelligence.v1beta2.AnnotateVideoResponse; +import com.google.cloud.videointelligence.v1beta2.Feature; +import com.google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceClient; +import java.util.ArrayList; +import java.util.List; + +public class SyncAnnotateVideoStringListfeature { + + public static void main(String[] args) throws Exception { + syncAnnotateVideoStringListfeature(); + } + + public static void syncAnnotateVideoStringListfeature() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create()) { + String inputUri = "inputUri470706498"; + List features = new ArrayList<>(); + AnnotateVideoResponse response = + videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get(); + } + } +} +// [END +// videointelligence_v1beta2_generated_videointelligenceserviceclient_annotatevideo_stringlistfeature_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java b/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 00000000000..ceaee81f088 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1beta2.samples; + +// [START +// videointelligence_v1beta2_generated_videointelligenceserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceSettings; +import com.google.cloud.videointelligence.v1beta2.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + VideoIntelligenceServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings); + } +} +// [END +// videointelligence_v1beta2_generated_videointelligenceserviceclient_create_setcredentialsprovider_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java b/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 00000000000..84bd5204241 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1beta2.samples; + +// [START +// videointelligence_v1beta2_generated_videointelligenceserviceclient_create_setcredentialsprovider1_sync] +import com.google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + VideoIntelligenceServiceSettings.newBuilder() + .setTransportChannelProvider( + VideoIntelligenceServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings); + } +} +// [END +// videointelligence_v1beta2_generated_videointelligenceserviceclient_create_setcredentialsprovider1_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java b/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 00000000000..42e9a82b744 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1beta2.samples; + +// [START +// videointelligence_v1beta2_generated_videointelligenceserviceclient_create_setendpoint_sync] +import com.google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceSettings; +import com.google.cloud.videointelligence.v1beta2.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + VideoIntelligenceServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings); + } +} +// [END videointelligence_v1beta2_generated_videointelligenceserviceclient_create_setendpoint_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java new file mode 100644 index 00000000000..801276110e4 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1beta2/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1beta2.samples; + +// [START videointelligence_v1beta2_generated_videointelligenceservicesettings_annotatevideo_sync] +import com.google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceSettings; +import java.time.Duration; + +public class SyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncAnnotateVideo(); + } + + public static void syncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings.Builder videoIntelligenceServiceSettingsBuilder = + VideoIntelligenceServiceSettings.newBuilder(); + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .setRetrySettings( + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + videoIntelligenceServiceSettingsBuilder.build(); + } +} +// [END videointelligence_v1beta2_generated_videointelligenceservicesettings_annotatevideo_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p1beta1/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1p1beta1/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java new file mode 100644 index 00000000000..0e1339a9883 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p1beta1/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p1beta1.stub.samples; + +// [START +// videointelligence_v1p1beta1_generated_videointelligenceservicestubsettings_annotatevideo_sync] +import com.google.cloud.videointelligence.v1p1beta1.stub.VideoIntelligenceServiceStubSettings; +import java.time.Duration; + +public class SyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncAnnotateVideo(); + } + + public static void syncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceStubSettings.Builder videoIntelligenceServiceSettingsBuilder = + VideoIntelligenceServiceStubSettings.newBuilder(); + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .setRetrySettings( + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + VideoIntelligenceServiceStubSettings videoIntelligenceServiceSettings = + videoIntelligenceServiceSettingsBuilder.build(); + } +} +// [END +// videointelligence_v1p1beta1_generated_videointelligenceservicestubsettings_annotatevideo_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java new file mode 100644 index 00000000000..8c224a2c2ee --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p1beta1.samples; + +// [START videointelligence_v1p1beta1_generated_videointelligenceserviceclient_annotatevideo_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1p1beta1.Feature; +import com.google.cloud.videointelligence.v1p1beta1.VideoContext; +import com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceClient; +import com.google.longrunning.Operation; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + asyncAnnotateVideo(); + } + + public static void asyncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + 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(); + } + } +} +// [END videointelligence_v1p1beta1_generated_videointelligenceserviceclient_annotatevideo_async] diff --git a/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java b/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java new file mode 100644 index 00000000000..f95fefb89d7 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p1beta1.samples; + +// [START +// videointelligence_v1p1beta1_generated_videointelligenceserviceclient_annotatevideo_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress; +import com.google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse; +import com.google.cloud.videointelligence.v1p1beta1.Feature; +import com.google.cloud.videointelligence.v1p1beta1.VideoContext; +import com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncAnnotateVideoLRO { + + public static void main(String[] args) throws Exception { + asyncAnnotateVideoLRO(); + } + + public static void asyncAnnotateVideoLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + 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(); + } + } +} +// [END +// videointelligence_v1p1beta1_generated_videointelligenceserviceclient_annotatevideo_lro_async] diff --git a/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java new file mode 100644 index 00000000000..e9cf0faeefc --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p1beta1.samples; + +// [START videointelligence_v1p1beta1_generated_videointelligenceserviceclient_annotatevideo_sync] +import com.google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse; +import com.google.cloud.videointelligence.v1p1beta1.Feature; +import com.google.cloud.videointelligence.v1p1beta1.VideoContext; +import com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class SyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncAnnotateVideo(); + } + + public static void syncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + 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(); + } + } +} +// [END videointelligence_v1p1beta1_generated_videointelligenceserviceclient_annotatevideo_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java b/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java new file mode 100644 index 00000000000..c7d0f5af805 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p1beta1.samples; + +// [START +// videointelligence_v1p1beta1_generated_videointelligenceserviceclient_annotatevideo_stringlistfeature_sync] +import com.google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse; +import com.google.cloud.videointelligence.v1p1beta1.Feature; +import com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceClient; +import java.util.ArrayList; +import java.util.List; + +public class SyncAnnotateVideoStringListfeature { + + public static void main(String[] args) throws Exception { + syncAnnotateVideoStringListfeature(); + } + + public static void syncAnnotateVideoStringListfeature() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create()) { + String inputUri = "inputUri470706498"; + List features = new ArrayList<>(); + AnnotateVideoResponse response = + videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get(); + } + } +} +// [END +// videointelligence_v1p1beta1_generated_videointelligenceserviceclient_annotatevideo_stringlistfeature_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java b/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 00000000000..4088eafe710 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p1beta1.samples; + +// [START +// videointelligence_v1p1beta1_generated_videointelligenceserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceSettings; +import com.google.cloud.videointelligence.v1p1beta1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + VideoIntelligenceServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings); + } +} +// [END +// videointelligence_v1p1beta1_generated_videointelligenceserviceclient_create_setcredentialsprovider_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java b/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 00000000000..68d9b64e459 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p1beta1.samples; + +// [START +// videointelligence_v1p1beta1_generated_videointelligenceserviceclient_create_setcredentialsprovider1_sync] +import com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + VideoIntelligenceServiceSettings.newBuilder() + .setTransportChannelProvider( + VideoIntelligenceServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings); + } +} +// [END +// videointelligence_v1p1beta1_generated_videointelligenceserviceclient_create_setcredentialsprovider1_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java b/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 00000000000..35a534c9fe8 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p1beta1.samples; + +// [START +// videointelligence_v1p1beta1_generated_videointelligenceserviceclient_create_setendpoint_sync] +import com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceSettings; +import com.google.cloud.videointelligence.v1p1beta1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + VideoIntelligenceServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings); + } +} +// [END +// videointelligence_v1p1beta1_generated_videointelligenceserviceclient_create_setendpoint_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java new file mode 100644 index 00000000000..2abad3fce93 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p1beta1/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p1beta1.samples; + +// [START videointelligence_v1p1beta1_generated_videointelligenceservicesettings_annotatevideo_sync] +import com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceSettings; +import java.time.Duration; + +public class SyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncAnnotateVideo(); + } + + public static void syncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings.Builder videoIntelligenceServiceSettingsBuilder = + VideoIntelligenceServiceSettings.newBuilder(); + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .setRetrySettings( + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + videoIntelligenceServiceSettingsBuilder.build(); + } +} +// [END videointelligence_v1p1beta1_generated_videointelligenceservicesettings_annotatevideo_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p2beta1/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1p2beta1/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java new file mode 100644 index 00000000000..160b44c2bf2 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p2beta1/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p2beta1.stub.samples; + +// [START +// videointelligence_v1p2beta1_generated_videointelligenceservicestubsettings_annotatevideo_sync] +import com.google.cloud.videointelligence.v1p2beta1.stub.VideoIntelligenceServiceStubSettings; +import java.time.Duration; + +public class SyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncAnnotateVideo(); + } + + public static void syncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceStubSettings.Builder videoIntelligenceServiceSettingsBuilder = + VideoIntelligenceServiceStubSettings.newBuilder(); + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .setRetrySettings( + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + VideoIntelligenceServiceStubSettings videoIntelligenceServiceSettings = + videoIntelligenceServiceSettingsBuilder.build(); + } +} +// [END +// videointelligence_v1p2beta1_generated_videointelligenceservicestubsettings_annotatevideo_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java new file mode 100644 index 00000000000..3fe41cdfcaa --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p2beta1.samples; + +// [START videointelligence_v1p2beta1_generated_videointelligenceserviceclient_annotatevideo_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1p2beta1.Feature; +import com.google.cloud.videointelligence.v1p2beta1.VideoContext; +import com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceClient; +import com.google.longrunning.Operation; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + asyncAnnotateVideo(); + } + + public static void asyncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + 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(); + } + } +} +// [END videointelligence_v1p2beta1_generated_videointelligenceserviceclient_annotatevideo_async] diff --git a/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java b/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java new file mode 100644 index 00000000000..7ddea1a281d --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p2beta1.samples; + +// [START +// videointelligence_v1p2beta1_generated_videointelligenceserviceclient_annotatevideo_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress; +import com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse; +import com.google.cloud.videointelligence.v1p2beta1.Feature; +import com.google.cloud.videointelligence.v1p2beta1.VideoContext; +import com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncAnnotateVideoLRO { + + public static void main(String[] args) throws Exception { + asyncAnnotateVideoLRO(); + } + + public static void asyncAnnotateVideoLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + 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(); + } + } +} +// [END +// videointelligence_v1p2beta1_generated_videointelligenceserviceclient_annotatevideo_lro_async] diff --git a/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java new file mode 100644 index 00000000000..981e87b550e --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p2beta1.samples; + +// [START videointelligence_v1p2beta1_generated_videointelligenceserviceclient_annotatevideo_sync] +import com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse; +import com.google.cloud.videointelligence.v1p2beta1.Feature; +import com.google.cloud.videointelligence.v1p2beta1.VideoContext; +import com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class SyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncAnnotateVideo(); + } + + public static void syncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + 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(); + } + } +} +// [END videointelligence_v1p2beta1_generated_videointelligenceserviceclient_annotatevideo_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java b/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java new file mode 100644 index 00000000000..efe6e536bba --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p2beta1.samples; + +// [START +// videointelligence_v1p2beta1_generated_videointelligenceserviceclient_annotatevideo_stringlistfeature_sync] +import com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse; +import com.google.cloud.videointelligence.v1p2beta1.Feature; +import com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceClient; +import java.util.ArrayList; +import java.util.List; + +public class SyncAnnotateVideoStringListfeature { + + public static void main(String[] args) throws Exception { + syncAnnotateVideoStringListfeature(); + } + + public static void syncAnnotateVideoStringListfeature() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create()) { + String inputUri = "inputUri470706498"; + List features = new ArrayList<>(); + AnnotateVideoResponse response = + videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get(); + } + } +} +// [END +// videointelligence_v1p2beta1_generated_videointelligenceserviceclient_annotatevideo_stringlistfeature_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java b/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 00000000000..d99688f2df5 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p2beta1.samples; + +// [START +// videointelligence_v1p2beta1_generated_videointelligenceserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceSettings; +import com.google.cloud.videointelligence.v1p2beta1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + VideoIntelligenceServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings); + } +} +// [END +// videointelligence_v1p2beta1_generated_videointelligenceserviceclient_create_setcredentialsprovider_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java b/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 00000000000..44d43793169 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p2beta1.samples; + +// [START +// videointelligence_v1p2beta1_generated_videointelligenceserviceclient_create_setcredentialsprovider1_sync] +import com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + VideoIntelligenceServiceSettings.newBuilder() + .setTransportChannelProvider( + VideoIntelligenceServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings); + } +} +// [END +// videointelligence_v1p2beta1_generated_videointelligenceserviceclient_create_setcredentialsprovider1_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java b/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 00000000000..9c5d26317ce --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p2beta1.samples; + +// [START +// videointelligence_v1p2beta1_generated_videointelligenceserviceclient_create_setendpoint_sync] +import com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceSettings; +import com.google.cloud.videointelligence.v1p2beta1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + VideoIntelligenceServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings); + } +} +// [END +// videointelligence_v1p2beta1_generated_videointelligenceserviceclient_create_setendpoint_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java new file mode 100644 index 00000000000..656af07ff30 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p2beta1/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p2beta1.samples; + +// [START videointelligence_v1p2beta1_generated_videointelligenceservicesettings_annotatevideo_sync] +import com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceSettings; +import java.time.Duration; + +public class SyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncAnnotateVideo(); + } + + public static void syncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings.Builder videoIntelligenceServiceSettingsBuilder = + VideoIntelligenceServiceSettings.newBuilder(); + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .setRetrySettings( + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + videoIntelligenceServiceSettingsBuilder.build(); + } +} +// [END videointelligence_v1p2beta1_generated_videointelligenceservicesettings_annotatevideo_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java b/video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 00000000000..7d19294d414 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p3beta1.samples; + +// [START +// videointelligence_v1p3beta1_generated_streamingvideointelligenceserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceServiceSettings; +import com.google.cloud.videointelligence.v1p3beta1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + StreamingVideoIntelligenceServiceSettings streamingVideoIntelligenceServiceSettings = + StreamingVideoIntelligenceServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + StreamingVideoIntelligenceServiceClient streamingVideoIntelligenceServiceClient = + StreamingVideoIntelligenceServiceClient.create(streamingVideoIntelligenceServiceSettings); + } +} +// [END +// videointelligence_v1p3beta1_generated_streamingvideointelligenceserviceclient_create_setcredentialsprovider_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java b/video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 00000000000..78e7f5ece75 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p3beta1.samples; + +// [START +// videointelligence_v1p3beta1_generated_streamingvideointelligenceserviceclient_create_setcredentialsprovider1_sync] +import com.google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + StreamingVideoIntelligenceServiceSettings streamingVideoIntelligenceServiceSettings = + StreamingVideoIntelligenceServiceSettings.newBuilder() + .setTransportChannelProvider( + StreamingVideoIntelligenceServiceSettings.defaultHttpJsonTransportProviderBuilder() + .build()) + .build(); + StreamingVideoIntelligenceServiceClient streamingVideoIntelligenceServiceClient = + StreamingVideoIntelligenceServiceClient.create(streamingVideoIntelligenceServiceSettings); + } +} +// [END +// videointelligence_v1p3beta1_generated_streamingvideointelligenceserviceclient_create_setcredentialsprovider1_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceserviceclient/create/SyncCreateSetEndpoint.java b/video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceserviceclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 00000000000..17abe666771 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceserviceclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p3beta1.samples; + +// [START +// videointelligence_v1p3beta1_generated_streamingvideointelligenceserviceclient_create_setendpoint_sync] +import com.google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceServiceSettings; +import com.google.cloud.videointelligence.v1p3beta1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + StreamingVideoIntelligenceServiceSettings streamingVideoIntelligenceServiceSettings = + StreamingVideoIntelligenceServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + StreamingVideoIntelligenceServiceClient streamingVideoIntelligenceServiceClient = + StreamingVideoIntelligenceServiceClient.create(streamingVideoIntelligenceServiceSettings); + } +} +// [END +// videointelligence_v1p3beta1_generated_streamingvideointelligenceserviceclient_create_setendpoint_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceserviceclient/streamingannotatevideo/AsyncStreamingAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceserviceclient/streamingannotatevideo/AsyncStreamingAnnotateVideo.java new file mode 100644 index 00000000000..ccc30e85ab3 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceserviceclient/streamingannotatevideo/AsyncStreamingAnnotateVideo.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p3beta1.samples; + +// [START +// videointelligence_v1p3beta1_generated_streamingvideointelligenceserviceclient_streamingannotatevideo_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest; +import com.google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse; +import com.google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceServiceClient; + +public class AsyncStreamingAnnotateVideo { + + public static void main(String[] args) throws Exception { + asyncStreamingAnnotateVideo(); + } + + public static void asyncStreamingAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + 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. + } + } + } +} +// [END +// videointelligence_v1p3beta1_generated_streamingvideointelligenceserviceclient_streamingannotatevideo_async] diff --git a/video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceservicesettings/streamingannotatevideo/SyncStreamingAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceservicesettings/streamingannotatevideo/SyncStreamingAnnotateVideo.java new file mode 100644 index 00000000000..8fac3c7ab08 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p3beta1/streamingvideointelligenceservicesettings/streamingannotatevideo/SyncStreamingAnnotateVideo.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p3beta1.samples; + +// [START +// videointelligence_v1p3beta1_generated_streamingvideointelligenceservicesettings_streamingannotatevideo_sync] +import com.google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceServiceSettings; +import java.time.Duration; + +public class SyncStreamingAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncStreamingAnnotateVideo(); + } + + public static void syncStreamingAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + StreamingVideoIntelligenceServiceSettings.Builder + streamingVideoIntelligenceServiceSettingsBuilder = + StreamingVideoIntelligenceServiceSettings.newBuilder(); + streamingVideoIntelligenceServiceSettingsBuilder + .streamingAnnotateVideoSettings() + .setRetrySettings( + streamingVideoIntelligenceServiceSettingsBuilder + .streamingAnnotateVideoSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + StreamingVideoIntelligenceServiceSettings streamingVideoIntelligenceServiceSettings = + streamingVideoIntelligenceServiceSettingsBuilder.build(); + } +} +// [END +// videointelligence_v1p3beta1_generated_streamingvideointelligenceservicesettings_streamingannotatevideo_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p3beta1/stub/streamingvideointelligenceservicestubsettings/streamingannotatevideo/SyncStreamingAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1p3beta1/stub/streamingvideointelligenceservicestubsettings/streamingannotatevideo/SyncStreamingAnnotateVideo.java new file mode 100644 index 00000000000..5cd4e0ca303 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p3beta1/stub/streamingvideointelligenceservicestubsettings/streamingannotatevideo/SyncStreamingAnnotateVideo.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p3beta1.stub.samples; + +// [START +// videointelligence_v1p3beta1_generated_streamingvideointelligenceservicestubsettings_streamingannotatevideo_sync] +import com.google.cloud.videointelligence.v1p3beta1.stub.StreamingVideoIntelligenceServiceStubSettings; +import java.time.Duration; + +public class SyncStreamingAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncStreamingAnnotateVideo(); + } + + public static void syncStreamingAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + StreamingVideoIntelligenceServiceStubSettings.Builder + streamingVideoIntelligenceServiceSettingsBuilder = + StreamingVideoIntelligenceServiceStubSettings.newBuilder(); + streamingVideoIntelligenceServiceSettingsBuilder + .streamingAnnotateVideoSettings() + .setRetrySettings( + streamingVideoIntelligenceServiceSettingsBuilder + .streamingAnnotateVideoSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + StreamingVideoIntelligenceServiceStubSettings streamingVideoIntelligenceServiceSettings = + streamingVideoIntelligenceServiceSettingsBuilder.build(); + } +} +// [END +// videointelligence_v1p3beta1_generated_streamingvideointelligenceservicestubsettings_streamingannotatevideo_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p3beta1/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1p3beta1/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java new file mode 100644 index 00000000000..56075a6d0d7 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p3beta1/stub/videointelligenceservicestubsettings/annotatevideo/SyncAnnotateVideo.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p3beta1.stub.samples; + +// [START +// videointelligence_v1p3beta1_generated_videointelligenceservicestubsettings_annotatevideo_sync] +import com.google.cloud.videointelligence.v1p3beta1.stub.VideoIntelligenceServiceStubSettings; +import java.time.Duration; + +public class SyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncAnnotateVideo(); + } + + public static void syncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceStubSettings.Builder videoIntelligenceServiceSettingsBuilder = + VideoIntelligenceServiceStubSettings.newBuilder(); + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .setRetrySettings( + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + VideoIntelligenceServiceStubSettings videoIntelligenceServiceSettings = + videoIntelligenceServiceSettingsBuilder.build(); + } +} +// [END +// videointelligence_v1p3beta1_generated_videointelligenceservicestubsettings_annotatevideo_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java new file mode 100644 index 00000000000..2d10cd08be6 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideo.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p3beta1.samples; + +// [START videointelligence_v1p3beta1_generated_videointelligenceserviceclient_annotatevideo_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1p3beta1.Feature; +import com.google.cloud.videointelligence.v1p3beta1.VideoContext; +import com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceClient; +import com.google.longrunning.Operation; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + asyncAnnotateVideo(); + } + + public static void asyncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + 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(); + } + } +} +// [END videointelligence_v1p3beta1_generated_videointelligenceserviceclient_annotatevideo_async] diff --git a/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java b/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java new file mode 100644 index 00000000000..f40391fab9e --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/annotatevideo/AsyncAnnotateVideoLRO.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p3beta1.samples; + +// [START +// videointelligence_v1p3beta1_generated_videointelligenceserviceclient_annotatevideo_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress; +import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse; +import com.google.cloud.videointelligence.v1p3beta1.Feature; +import com.google.cloud.videointelligence.v1p3beta1.VideoContext; +import com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncAnnotateVideoLRO { + + public static void main(String[] args) throws Exception { + asyncAnnotateVideoLRO(); + } + + public static void asyncAnnotateVideoLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + 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(); + } + } +} +// [END +// videointelligence_v1p3beta1_generated_videointelligenceserviceclient_annotatevideo_lro_async] diff --git a/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java new file mode 100644 index 00000000000..91e2e489229 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideo.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p3beta1.samples; + +// [START videointelligence_v1p3beta1_generated_videointelligenceserviceclient_annotatevideo_sync] +import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse; +import com.google.cloud.videointelligence.v1p3beta1.Feature; +import com.google.cloud.videointelligence.v1p3beta1.VideoContext; +import com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class SyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncAnnotateVideo(); + } + + public static void syncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + 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(); + } + } +} +// [END videointelligence_v1p3beta1_generated_videointelligenceserviceclient_annotatevideo_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java b/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java new file mode 100644 index 00000000000..4024aab1de1 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/annotatevideo/SyncAnnotateVideoStringListfeature.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p3beta1.samples; + +// [START +// videointelligence_v1p3beta1_generated_videointelligenceserviceclient_annotatevideo_stringlistfeature_sync] +import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse; +import com.google.cloud.videointelligence.v1p3beta1.Feature; +import com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceClient; +import java.util.ArrayList; +import java.util.List; + +public class SyncAnnotateVideoStringListfeature { + + public static void main(String[] args) throws Exception { + syncAnnotateVideoStringListfeature(); + } + + public static void syncAnnotateVideoStringListfeature() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create()) { + String inputUri = "inputUri470706498"; + List features = new ArrayList<>(); + AnnotateVideoResponse response = + videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get(); + } + } +} +// [END +// videointelligence_v1p3beta1_generated_videointelligenceserviceclient_annotatevideo_stringlistfeature_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java b/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 00000000000..e36036c09ba --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p3beta1.samples; + +// [START +// videointelligence_v1p3beta1_generated_videointelligenceserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceSettings; +import com.google.cloud.videointelligence.v1p3beta1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + VideoIntelligenceServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings); + } +} +// [END +// videointelligence_v1p3beta1_generated_videointelligenceserviceclient_create_setcredentialsprovider_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java b/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 00000000000..d8748bf2f46 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p3beta1.samples; + +// [START +// videointelligence_v1p3beta1_generated_videointelligenceserviceclient_create_setcredentialsprovider1_sync] +import com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + VideoIntelligenceServiceSettings.newBuilder() + .setTransportChannelProvider( + VideoIntelligenceServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings); + } +} +// [END +// videointelligence_v1p3beta1_generated_videointelligenceserviceclient_create_setcredentialsprovider1_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java b/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 00000000000..03819a397ec --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceserviceclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p3beta1.samples; + +// [START +// videointelligence_v1p3beta1_generated_videointelligenceserviceclient_create_setendpoint_sync] +import com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceClient; +import com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceSettings; +import com.google.cloud.videointelligence.v1p3beta1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + VideoIntelligenceServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + VideoIntelligenceServiceClient videoIntelligenceServiceClient = + VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings); + } +} +// [END +// videointelligence_v1p3beta1_generated_videointelligenceserviceclient_create_setendpoint_sync] diff --git a/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java b/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java new file mode 100644 index 00000000000..d3c9c22fbb1 --- /dev/null +++ b/video/generated/com/google/cloud/videointelligence/v1p3beta1/videointelligenceservicesettings/annotatevideo/SyncAnnotateVideo.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.videointelligence.v1p3beta1.samples; + +// [START videointelligence_v1p3beta1_generated_videointelligenceservicesettings_annotatevideo_sync] +import com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceSettings; +import java.time.Duration; + +public class SyncAnnotateVideo { + + public static void main(String[] args) throws Exception { + syncAnnotateVideo(); + } + + public static void syncAnnotateVideo() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + VideoIntelligenceServiceSettings.Builder videoIntelligenceServiceSettingsBuilder = + VideoIntelligenceServiceSettings.newBuilder(); + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .setRetrySettings( + videoIntelligenceServiceSettingsBuilder + .annotateVideoSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = + videoIntelligenceServiceSettingsBuilder.build(); + } +} +// [END videointelligence_v1p3beta1_generated_videointelligenceservicesettings_annotatevideo_sync]