From 59d5abfd75d24e87bd5b98600dafcbf674316f54 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 16 Mar 2021 08:44:08 -0700 Subject: [PATCH] feat: Support output transcript to GCS for LongRunningRecognize (#471) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/6052dd28-5243-4ec5-b111-b1f991d613d9/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 362934100 Source-Link: https://github.com/googleapis/googleapis/commit/72326861be446be27d53af95c87e6e313367c371 PiperOrigin-RevId: 362856902 Source-Link: https://github.com/googleapis/googleapis/commit/1305ca41d554eb0725237561e34129373bb8cbc1 chore: update java microgenerator to 1.0.2 Adds request initialization to sample code --- .../speech/v1p1beta1/AdaptationClient.java | 12 + .../cloud/speech/v1/MockSpeechImpl.java | 10 +- .../speech/v1p1beta1/MockAdaptationImpl.java | 40 +- .../speech/v1p1beta1/MockSpeechImpl.java | 10 +- .../speech/v1p1beta1/SpeechClientTest.java | 2 + .../LongRunningRecognizeMetadata.java | 307 ++++++++++ ...LongRunningRecognizeMetadataOrBuilder.java | 41 ++ .../LongRunningRecognizeResponse.java | 546 ++++++++++++++++++ ...LongRunningRecognizeResponseOrBuilder.java | 70 +++ .../cloud/speech/v1p1beta1/SpeechProto.java | 117 ++-- .../cloud/speech/v1p1beta1/cloud_speech.proto | 9 + synth.metadata | 10 +- 12 files changed, 1083 insertions(+), 91 deletions(-) diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java index 5ae326828..8263c6148 100644 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java +++ b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java @@ -478,6 +478,12 @@ public final ListPhraseSetPagedResponse listPhraseSet(ListPhraseSetRequest reque * *
{@code
    * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListPhraseSetRequest request =
+   *       ListPhraseSetRequest.newBuilder()
+   *           .setParent(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
    *   while (true) {
    *     ListPhraseSetResponse response = adaptationClient.listPhraseSetCallable().call(request);
    *     for (PhraseSet element : response.getResponsesList()) {
@@ -986,6 +992,12 @@ public final ListCustomClassesPagedResponse listCustomClasses(ListCustomClassesR
    *
    * 
{@code
    * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListCustomClassesRequest request =
+   *       ListCustomClassesRequest.newBuilder()
+   *           .setParent(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
    *   while (true) {
    *     ListCustomClassesResponse response =
    *         adaptationClient.listCustomClassesCallable().call(request);
diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java
index 023bc733f..d626070c1 100644
--- a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java
+++ b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java
@@ -62,7 +62,7 @@ public void reset() {
   @Override
   public void recognize(
       RecognizeRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof RecognizeResponse) {
       requests.add(request);
       responseObserver.onNext(((RecognizeResponse) response));
@@ -74,7 +74,7 @@ public void recognize(
           new IllegalArgumentException(
               String.format(
                   "Unrecognized response type %s for method Recognize, expected %s or %s",
-                  response.getClass().getName(),
+                  response == null ? "null" : response.getClass().getName(),
                   RecognizeResponse.class.getName(),
                   Exception.class.getName())));
     }
@@ -83,7 +83,7 @@ public void recognize(
   @Override
   public void longRunningRecognize(
       LongRunningRecognizeRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof Operation) {
       requests.add(request);
       responseObserver.onNext(((Operation) response));
@@ -95,7 +95,7 @@ public void longRunningRecognize(
           new IllegalArgumentException(
               String.format(
                   "Unrecognized response type %s for method LongRunningRecognize, expected %s or %s",
-                  response.getClass().getName(),
+                  response == null ? "null" : response.getClass().getName(),
                   Operation.class.getName(),
                   Exception.class.getName())));
     }
@@ -119,7 +119,7 @@ public void onNext(StreamingRecognizeRequest value) {
                   new IllegalArgumentException(
                       String.format(
                           "Unrecognized response type %s for method StreamingRecognize, expected %s or %s",
-                          response.getClass().getName(),
+                          response == null ? "null" : response.getClass().getName(),
                           StreamingRecognizeResponse.class.getName(),
                           Exception.class.getName())));
             }
diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java
index c3af7b8c7..7a4440c08 100644
--- a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java
+++ b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java
@@ -62,7 +62,7 @@ public void reset() {
   @Override
   public void createPhraseSet(
       CreatePhraseSetRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof PhraseSet) {
       requests.add(request);
       responseObserver.onNext(((PhraseSet) response));
@@ -74,7 +74,7 @@ public void createPhraseSet(
           new IllegalArgumentException(
               String.format(
                   "Unrecognized response type %s for method CreatePhraseSet, expected %s or %s",
-                  response.getClass().getName(),
+                  response == null ? "null" : response.getClass().getName(),
                   PhraseSet.class.getName(),
                   Exception.class.getName())));
     }
@@ -83,7 +83,7 @@ public void createPhraseSet(
   @Override
   public void getPhraseSet(
       GetPhraseSetRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof PhraseSet) {
       requests.add(request);
       responseObserver.onNext(((PhraseSet) response));
@@ -95,7 +95,7 @@ public void getPhraseSet(
           new IllegalArgumentException(
               String.format(
                   "Unrecognized response type %s for method GetPhraseSet, expected %s or %s",
-                  response.getClass().getName(),
+                  response == null ? "null" : response.getClass().getName(),
                   PhraseSet.class.getName(),
                   Exception.class.getName())));
     }
@@ -104,7 +104,7 @@ public void getPhraseSet(
   @Override
   public void listPhraseSet(
       ListPhraseSetRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof ListPhraseSetResponse) {
       requests.add(request);
       responseObserver.onNext(((ListPhraseSetResponse) response));
@@ -116,7 +116,7 @@ public void listPhraseSet(
           new IllegalArgumentException(
               String.format(
                   "Unrecognized response type %s for method ListPhraseSet, expected %s or %s",
-                  response.getClass().getName(),
+                  response == null ? "null" : response.getClass().getName(),
                   ListPhraseSetResponse.class.getName(),
                   Exception.class.getName())));
     }
@@ -125,7 +125,7 @@ public void listPhraseSet(
   @Override
   public void updatePhraseSet(
       UpdatePhraseSetRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof PhraseSet) {
       requests.add(request);
       responseObserver.onNext(((PhraseSet) response));
@@ -137,7 +137,7 @@ public void updatePhraseSet(
           new IllegalArgumentException(
               String.format(
                   "Unrecognized response type %s for method UpdatePhraseSet, expected %s or %s",
-                  response.getClass().getName(),
+                  response == null ? "null" : response.getClass().getName(),
                   PhraseSet.class.getName(),
                   Exception.class.getName())));
     }
@@ -146,7 +146,7 @@ public void updatePhraseSet(
   @Override
   public void deletePhraseSet(
       DeletePhraseSetRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof Empty) {
       requests.add(request);
       responseObserver.onNext(((Empty) response));
@@ -158,7 +158,7 @@ public void deletePhraseSet(
           new IllegalArgumentException(
               String.format(
                   "Unrecognized response type %s for method DeletePhraseSet, expected %s or %s",
-                  response.getClass().getName(),
+                  response == null ? "null" : response.getClass().getName(),
                   Empty.class.getName(),
                   Exception.class.getName())));
     }
@@ -167,7 +167,7 @@ public void deletePhraseSet(
   @Override
   public void createCustomClass(
       CreateCustomClassRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof CustomClass) {
       requests.add(request);
       responseObserver.onNext(((CustomClass) response));
@@ -179,7 +179,7 @@ public void createCustomClass(
           new IllegalArgumentException(
               String.format(
                   "Unrecognized response type %s for method CreateCustomClass, expected %s or %s",
-                  response.getClass().getName(),
+                  response == null ? "null" : response.getClass().getName(),
                   CustomClass.class.getName(),
                   Exception.class.getName())));
     }
@@ -188,7 +188,7 @@ public void createCustomClass(
   @Override
   public void getCustomClass(
       GetCustomClassRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof CustomClass) {
       requests.add(request);
       responseObserver.onNext(((CustomClass) response));
@@ -200,7 +200,7 @@ public void getCustomClass(
           new IllegalArgumentException(
               String.format(
                   "Unrecognized response type %s for method GetCustomClass, expected %s or %s",
-                  response.getClass().getName(),
+                  response == null ? "null" : response.getClass().getName(),
                   CustomClass.class.getName(),
                   Exception.class.getName())));
     }
@@ -210,7 +210,7 @@ public void getCustomClass(
   public void listCustomClasses(
       ListCustomClassesRequest request,
       StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof ListCustomClassesResponse) {
       requests.add(request);
       responseObserver.onNext(((ListCustomClassesResponse) response));
@@ -222,7 +222,7 @@ public void listCustomClasses(
           new IllegalArgumentException(
               String.format(
                   "Unrecognized response type %s for method ListCustomClasses, expected %s or %s",
-                  response.getClass().getName(),
+                  response == null ? "null" : response.getClass().getName(),
                   ListCustomClassesResponse.class.getName(),
                   Exception.class.getName())));
     }
@@ -231,7 +231,7 @@ public void listCustomClasses(
   @Override
   public void updateCustomClass(
       UpdateCustomClassRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof CustomClass) {
       requests.add(request);
       responseObserver.onNext(((CustomClass) response));
@@ -243,7 +243,7 @@ public void updateCustomClass(
           new IllegalArgumentException(
               String.format(
                   "Unrecognized response type %s for method UpdateCustomClass, expected %s or %s",
-                  response.getClass().getName(),
+                  response == null ? "null" : response.getClass().getName(),
                   CustomClass.class.getName(),
                   Exception.class.getName())));
     }
@@ -252,7 +252,7 @@ public void updateCustomClass(
   @Override
   public void deleteCustomClass(
       DeleteCustomClassRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof Empty) {
       requests.add(request);
       responseObserver.onNext(((Empty) response));
@@ -264,7 +264,7 @@ public void deleteCustomClass(
           new IllegalArgumentException(
               String.format(
                   "Unrecognized response type %s for method DeleteCustomClass, expected %s or %s",
-                  response.getClass().getName(),
+                  response == null ? "null" : response.getClass().getName(),
                   Empty.class.getName(),
                   Exception.class.getName())));
     }
diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java
index 0eb680b24..6b910967a 100644
--- a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java
+++ b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java
@@ -62,7 +62,7 @@ public void reset() {
   @Override
   public void recognize(
       RecognizeRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof RecognizeResponse) {
       requests.add(request);
       responseObserver.onNext(((RecognizeResponse) response));
@@ -74,7 +74,7 @@ public void recognize(
           new IllegalArgumentException(
               String.format(
                   "Unrecognized response type %s for method Recognize, expected %s or %s",
-                  response.getClass().getName(),
+                  response == null ? "null" : response.getClass().getName(),
                   RecognizeResponse.class.getName(),
                   Exception.class.getName())));
     }
@@ -83,7 +83,7 @@ public void recognize(
   @Override
   public void longRunningRecognize(
       LongRunningRecognizeRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof Operation) {
       requests.add(request);
       responseObserver.onNext(((Operation) response));
@@ -95,7 +95,7 @@ public void longRunningRecognize(
           new IllegalArgumentException(
               String.format(
                   "Unrecognized response type %s for method LongRunningRecognize, expected %s or %s",
-                  response.getClass().getName(),
+                  response == null ? "null" : response.getClass().getName(),
                   Operation.class.getName(),
                   Exception.class.getName())));
     }
@@ -119,7 +119,7 @@ public void onNext(StreamingRecognizeRequest value) {
                   new IllegalArgumentException(
                       String.format(
                           "Unrecognized response type %s for method StreamingRecognize, expected %s or %s",
-                          response.getClass().getName(),
+                          response == null ? "null" : response.getClass().getName(),
                           StreamingRecognizeResponse.class.getName(),
                           Exception.class.getName())));
             }
diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java
index ccfeb1f8f..50dbffe4a 100644
--- a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java
+++ b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java
@@ -130,6 +130,8 @@ public void longRunningRecognizeTest() throws Exception {
     LongRunningRecognizeResponse expectedResponse =
         LongRunningRecognizeResponse.newBuilder()
             .addAllResults(new ArrayList())
+            .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
+            .setOutputError(Status.newBuilder().build())
             .build();
     Operation resultOperation =
         Operation.newBuilder()
diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java
index 33968d0b4..ef69acc37 100644
--- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java
+++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java
@@ -112,6 +112,23 @@ private LongRunningRecognizeMetadata(
               java.lang.String s = input.readStringRequireUtf8();
 
               uri_ = s;
+              break;
+            }
+          case 42:
+            {
+              com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder subBuilder = null;
+              if (outputConfig_ != null) {
+                subBuilder = outputConfig_.toBuilder();
+              }
+              outputConfig_ =
+                  input.readMessage(
+                      com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.parser(),
+                      extensionRegistry);
+              if (subBuilder != null) {
+                subBuilder.mergeFrom(outputConfig_);
+                outputConfig_ = subBuilder.buildPartial();
+              }
+
               break;
             }
           default:
@@ -312,6 +329,61 @@ public com.google.protobuf.ByteString getUriBytes() {
     }
   }
 
+  public static final int OUTPUT_CONFIG_FIELD_NUMBER = 5;
+  private com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig outputConfig_;
+  /**
+   *
+   *
+   * 
+   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the outputConfig field is set. + */ + @java.lang.Override + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + * + * + *
+   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The outputConfig. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig() { + return outputConfig_ == null + ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() + : outputConfig_; + } + /** + * + * + *
+   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder + getOutputConfigOrBuilder() { + return getOutputConfig(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -338,6 +410,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!getUriBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, uri_); } + if (outputConfig_ != null) { + output.writeMessage(5, getOutputConfig()); + } unknownFields.writeTo(output); } @@ -359,6 +434,9 @@ public int getSerializedSize() { if (!getUriBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, uri_); } + if (outputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getOutputConfig()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -385,6 +463,10 @@ public boolean equals(final java.lang.Object obj) { if (!getLastUpdateTime().equals(other.getLastUpdateTime())) return false; } if (!getUri().equals(other.getUri())) return false; + if (hasOutputConfig() != other.hasOutputConfig()) return false; + if (hasOutputConfig()) { + if (!getOutputConfig().equals(other.getOutputConfig())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -408,6 +490,10 @@ public int hashCode() { } hash = (37 * hash) + URI_FIELD_NUMBER; hash = (53 * hash) + getUri().hashCode(); + if (hasOutputConfig()) { + hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputConfig().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -572,6 +658,12 @@ public Builder clear() { } uri_ = ""; + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } return this; } @@ -612,6 +704,11 @@ public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata buildParti result.lastUpdateTime_ = lastUpdateTimeBuilder_.build(); } result.uri_ = uri_; + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } onBuilt(); return result; } @@ -676,6 +773,9 @@ public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeM uri_ = other.uri_; onChanged(); } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1237,6 +1337,213 @@ public Builder setUriBytes(com.google.protobuf.ByteString value) { return this; } + private com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder> + outputConfigBuilder_; + /** + * + * + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the outputConfig field is set. + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + * + * + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The outputConfig. + */ + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null + ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() + : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setOutputConfig(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + onChanged(); + } else { + outputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setOutputConfig( + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + onChanged(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeOutputConfig( + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.newBuilder(outputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearOutputConfig() { + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + onChanged(); + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder + getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder + getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null + ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() + : outputConfig_; + } + } + /** + * + * + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder>( + getOutputConfig(), getParentForChildren(), isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java index 07cf90a75..0016ab958 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java @@ -133,4 +133,45 @@ public interface LongRunningRecognizeMetadataOrBuilder * @return The bytes for uri. */ com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the outputConfig field is set. + */ + boolean hasOutputConfig(); + /** + * + * + *
+   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The outputConfig. + */ + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig(); + /** + * + * + *
+   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder(); } diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java index 7536e6be4..e598b323e 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java @@ -89,6 +89,37 @@ private LongRunningRecognizeResponse( extensionRegistry)); break; } + case 50: + { + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = + input.readMessage( + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + com.google.rpc.Status.Builder subBuilder = null; + if (outputError_ != null) { + subBuilder = outputError_.toBuilder(); + } + outputError_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputError_); + outputError_ = subBuilder.buildPartial(); + } + + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -203,6 +234,101 @@ public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getRes return results_.get(index); } + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 6; + private com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig outputConfig_; + /** + * + * + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + * + * @return Whether the outputConfig field is set. + */ + @java.lang.Override + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + * + * + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + * + * @return The outputConfig. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig() { + return outputConfig_ == null + ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() + : outputConfig_; + } + /** + * + * + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder + getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + public static final int OUTPUT_ERROR_FIELD_NUMBER = 7; + private com.google.rpc.Status outputError_; + /** + * + * + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + * + * @return Whether the outputError field is set. + */ + @java.lang.Override + public boolean hasOutputError() { + return outputError_ != null; + } + /** + * + * + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + * + * @return The outputError. + */ + @java.lang.Override + public com.google.rpc.Status getOutputError() { + return outputError_ == null ? com.google.rpc.Status.getDefaultInstance() : outputError_; + } + /** + * + * + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder() { + return getOutputError(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -220,6 +346,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < results_.size(); i++) { output.writeMessage(2, results_.get(i)); } + if (outputConfig_ != null) { + output.writeMessage(6, getOutputConfig()); + } + if (outputError_ != null) { + output.writeMessage(7, getOutputError()); + } unknownFields.writeTo(output); } @@ -232,6 +364,12 @@ public int getSerializedSize() { for (int i = 0; i < results_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, results_.get(i)); } + if (outputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getOutputConfig()); + } + if (outputError_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getOutputError()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -249,6 +387,14 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) obj; if (!getResultsList().equals(other.getResultsList())) return false; + if (hasOutputConfig() != other.hasOutputConfig()) return false; + if (hasOutputConfig()) { + if (!getOutputConfig().equals(other.getOutputConfig())) return false; + } + if (hasOutputError() != other.hasOutputError()) return false; + if (hasOutputError()) { + if (!getOutputError().equals(other.getOutputError())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -264,6 +410,14 @@ public int hashCode() { hash = (37 * hash) + RESULTS_FIELD_NUMBER; hash = (53 * hash) + getResultsList().hashCode(); } + if (hasOutputConfig()) { + hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputConfig().hashCode(); + } + if (hasOutputError()) { + hash = (37 * hash) + OUTPUT_ERROR_FIELD_NUMBER; + hash = (53 * hash) + getOutputError().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -422,6 +576,18 @@ public Builder clear() { } else { resultsBuilder_.clear(); } + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + if (outputErrorBuilder_ == null) { + outputError_ = null; + } else { + outputError_ = null; + outputErrorBuilder_ = null; + } return this; } @@ -460,6 +626,16 @@ public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse buildParti } else { result.results_ = resultsBuilder_.build(); } + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + if (outputErrorBuilder_ == null) { + result.outputError_ = outputError_; + } else { + result.outputError_ = outputErrorBuilder_.build(); + } onBuilt(); return result; } @@ -538,6 +714,12 @@ public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeR } } } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + if (other.hasOutputError()) { + mergeOutputError(other.getOutputError()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -954,6 +1136,370 @@ public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder addResu return resultsBuilder_; } + private com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder> + outputConfigBuilder_; + /** + * + * + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + * + * @return Whether the outputConfig field is set. + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + * + * + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + * + * @return The outputConfig. + */ + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null + ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() + : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + public Builder setOutputConfig(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + onChanged(); + } else { + outputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + public Builder setOutputConfig( + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + onChanged(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + public Builder mergeOutputConfig( + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.newBuilder(outputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + public Builder clearOutputConfig() { + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + onChanged(); + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder + getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder + getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null + ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() + : outputConfig_; + } + } + /** + * + * + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder>( + getOutputConfig(), getParentForChildren(), isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + + private com.google.rpc.Status outputError_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + outputErrorBuilder_; + /** + * + * + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + * + * @return Whether the outputError field is set. + */ + public boolean hasOutputError() { + return outputErrorBuilder_ != null || outputError_ != null; + } + /** + * + * + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + * + * @return The outputError. + */ + public com.google.rpc.Status getOutputError() { + if (outputErrorBuilder_ == null) { + return outputError_ == null ? com.google.rpc.Status.getDefaultInstance() : outputError_; + } else { + return outputErrorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public Builder setOutputError(com.google.rpc.Status value) { + if (outputErrorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputError_ = value; + onChanged(); + } else { + outputErrorBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public Builder setOutputError(com.google.rpc.Status.Builder builderForValue) { + if (outputErrorBuilder_ == null) { + outputError_ = builderForValue.build(); + onChanged(); + } else { + outputErrorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public Builder mergeOutputError(com.google.rpc.Status value) { + if (outputErrorBuilder_ == null) { + if (outputError_ != null) { + outputError_ = + com.google.rpc.Status.newBuilder(outputError_).mergeFrom(value).buildPartial(); + } else { + outputError_ = value; + } + onChanged(); + } else { + outputErrorBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public Builder clearOutputError() { + if (outputErrorBuilder_ == null) { + outputError_ = null; + onChanged(); + } else { + outputError_ = null; + outputErrorBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public com.google.rpc.Status.Builder getOutputErrorBuilder() { + + onChanged(); + return getOutputErrorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder() { + if (outputErrorBuilder_ != null) { + return outputErrorBuilder_.getMessageOrBuilder(); + } else { + return outputError_ == null ? com.google.rpc.Status.getDefaultInstance() : outputError_; + } + } + /** + * + * + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getOutputErrorFieldBuilder() { + if (outputErrorBuilder_ == null) { + outputErrorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + getOutputError(), getParentForChildren(), isClean()); + outputError_ = null; + } + return outputErrorBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java index 20a34f17a..ce888f9f5 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java @@ -79,4 +79,74 @@ public interface LongRunningRecognizeResponseOrBuilder * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; */ com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder(int index); + + /** + * + * + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + * + * @return Whether the outputConfig field is set. + */ + boolean hasOutputConfig(); + /** + * + * + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + * + * @return The outputConfig. + */ + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig(); + /** + * + * + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder(); + + /** + * + * + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + * + * @return Whether the outputError field is set. + */ + boolean hasOutputError(); + /** + * + * + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + * + * @return The outputError. + */ + com.google.rpc.Status getOutputError(); + /** + * + * + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + */ + com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder(); } diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java index 208bf86bb..900dca2b3 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java @@ -198,60 +198,65 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "io\022\021\n\007content\030\001 \001(\014H\000\022\r\n\003uri\030\002 \001(\tH\000B\016\n\014" + "audio_source\"\\\n\021RecognizeResponse\022G\n\007res" + "ults\030\002 \003(\01326.google.cloud.speech.v1p1bet" - + "a1.SpeechRecognitionResult\"g\n\034LongRunnin" - + "gRecognizeResponse\022G\n\007results\030\002 \003(\01326.go" - + "ogle.cloud.speech.v1p1beta1.SpeechRecogn" - + "itionResult\"\260\001\n\034LongRunningRecognizeMeta" - + "data\022\030\n\020progress_percent\030\001 \001(\005\022.\n\nstart_" - + "time\030\002 \001(\0132\032.google.protobuf.Timestamp\0224" - + "\n\020last_update_time\030\003 \001(\0132\032.google.protob" - + "uf.Timestamp\022\020\n\003uri\030\004 \001(\tB\003\340A\003\"\277\002\n\032Strea" - + "mingRecognizeResponse\022!\n\005error\030\001 \001(\0132\022.g" - + "oogle.rpc.Status\022J\n\007results\030\002 \003(\01329.goog" - + "le.cloud.speech.v1p1beta1.StreamingRecog" - + "nitionResult\022d\n\021speech_event_type\030\004 \001(\0162" - + "I.google.cloud.speech.v1p1beta1.Streamin" - + "gRecognizeResponse.SpeechEventType\"L\n\017Sp" - + "eechEventType\022\034\n\030SPEECH_EVENT_UNSPECIFIE" - + "D\020\000\022\033\n\027END_OF_SINGLE_UTTERANCE\020\001\"\371\001\n\032Str" - + "eamingRecognitionResult\022Q\n\014alternatives\030" - + "\001 \003(\0132;.google.cloud.speech.v1p1beta1.Sp" - + "eechRecognitionAlternative\022\020\n\010is_final\030\002" - + " \001(\010\022\021\n\tstability\030\003 \001(\002\0222\n\017result_end_ti" - + "me\030\004 \001(\0132\031.google.protobuf.Duration\022\023\n\013c" - + "hannel_tag\030\005 \001(\005\022\032\n\rlanguage_code\030\006 \001(\tB" - + "\003\340A\003\"\235\001\n\027SpeechRecognitionResult\022Q\n\014alte" - + "rnatives\030\001 \003(\0132;.google.cloud.speech.v1p" - + "1beta1.SpeechRecognitionAlternative\022\023\n\013c" - + "hannel_tag\030\002 \001(\005\022\032\n\rlanguage_code\030\005 \001(\tB" - + "\003\340A\003\"~\n\034SpeechRecognitionAlternative\022\022\n\n" - + "transcript\030\001 \001(\t\022\022\n\nconfidence\030\002 \001(\002\0226\n\005" - + "words\030\003 \003(\0132\'.google.cloud.speech.v1p1be" - + "ta1.WordInfo\"\242\001\n\010WordInfo\022-\n\nstart_time\030" - + "\001 \001(\0132\031.google.protobuf.Duration\022+\n\010end_" - + "time\030\002 \001(\0132\031.google.protobuf.Duration\022\014\n" - + "\004word\030\003 \001(\t\022\022\n\nconfidence\030\004 \001(\002\022\030\n\013speak" - + "er_tag\030\005 \001(\005B\003\340A\0032\202\005\n\006Speech\022\245\001\n\tRecogni" - + "ze\022/.google.cloud.speech.v1p1beta1.Recog" - + "nizeRequest\0320.google.cloud.speech.v1p1be" - + "ta1.RecognizeResponse\"5\202\323\344\223\002 \"\033/v1p1beta" - + "1/speech:recognize:\001*\332A\014config,audio\022\362\001\n" - + "\024LongRunningRecognize\022:.google.cloud.spe" - + "ech.v1p1beta1.LongRunningRecognizeReques" - + "t\032\035.google.longrunning.Operation\"\177\202\323\344\223\002+" - + "\"&/v1p1beta1/speech:longrunningrecognize" - + ":\001*\332A\014config,audio\312A<\n\034LongRunningRecogn" - + "izeResponse\022\034LongRunningRecognizeMetadat" - + "a\022\217\001\n\022StreamingRecognize\0228.google.cloud." - + "speech.v1p1beta1.StreamingRecognizeReque" - + "st\0329.google.cloud.speech.v1p1beta1.Strea" - + "mingRecognizeResponse\"\000(\0010\001\032I\312A\025speech.g" - + "oogleapis.com\322A.https://www.googleapis.c" - + "om/auth/cloud-platformB\200\001\n!com.google.cl" - + "oud.speech.v1p1beta1B\013SpeechProtoP\001ZCgoo" - + "gle.golang.org/genproto/googleapis/cloud" - + "/speech/v1p1beta1;speech\370\001\001\242\002\003GCSb\006proto" - + "3" + + "a1.SpeechRecognitionResult\"\337\001\n\034LongRunni" + + "ngRecognizeResponse\022G\n\007results\030\002 \003(\01326.g" + + "oogle.cloud.speech.v1p1beta1.SpeechRecog" + + "nitionResult\022L\n\routput_config\030\006 \001(\01325.go" + + "ogle.cloud.speech.v1p1beta1.TranscriptOu" + + "tputConfig\022(\n\014output_error\030\007 \001(\0132\022.googl" + + "e.rpc.Status\"\203\002\n\034LongRunningRecognizeMet" + + "adata\022\030\n\020progress_percent\030\001 \001(\005\022.\n\nstart" + + "_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022" + + "4\n\020last_update_time\030\003 \001(\0132\032.google.proto" + + "buf.Timestamp\022\020\n\003uri\030\004 \001(\tB\003\340A\003\022Q\n\routpu" + + "t_config\030\005 \001(\01325.google.cloud.speech.v1p" + + "1beta1.TranscriptOutputConfigB\003\340A\003\"\277\002\n\032S" + + "treamingRecognizeResponse\022!\n\005error\030\001 \001(\013" + + "2\022.google.rpc.Status\022J\n\007results\030\002 \003(\01329." + + "google.cloud.speech.v1p1beta1.StreamingR" + + "ecognitionResult\022d\n\021speech_event_type\030\004 " + + "\001(\0162I.google.cloud.speech.v1p1beta1.Stre" + + "amingRecognizeResponse.SpeechEventType\"L" + + "\n\017SpeechEventType\022\034\n\030SPEECH_EVENT_UNSPEC" + + "IFIED\020\000\022\033\n\027END_OF_SINGLE_UTTERANCE\020\001\"\371\001\n" + + "\032StreamingRecognitionResult\022Q\n\014alternati" + + "ves\030\001 \003(\0132;.google.cloud.speech.v1p1beta" + + "1.SpeechRecognitionAlternative\022\020\n\010is_fin" + + "al\030\002 \001(\010\022\021\n\tstability\030\003 \001(\002\0222\n\017result_en" + + "d_time\030\004 \001(\0132\031.google.protobuf.Duration\022" + + "\023\n\013channel_tag\030\005 \001(\005\022\032\n\rlanguage_code\030\006 " + + "\001(\tB\003\340A\003\"\235\001\n\027SpeechRecognitionResult\022Q\n\014" + + "alternatives\030\001 \003(\0132;.google.cloud.speech" + + ".v1p1beta1.SpeechRecognitionAlternative\022" + + "\023\n\013channel_tag\030\002 \001(\005\022\032\n\rlanguage_code\030\005 " + + "\001(\tB\003\340A\003\"~\n\034SpeechRecognitionAlternative" + + "\022\022\n\ntranscript\030\001 \001(\t\022\022\n\nconfidence\030\002 \001(\002" + + "\0226\n\005words\030\003 \003(\0132\'.google.cloud.speech.v1" + + "p1beta1.WordInfo\"\242\001\n\010WordInfo\022-\n\nstart_t" + + "ime\030\001 \001(\0132\031.google.protobuf.Duration\022+\n\010" + + "end_time\030\002 \001(\0132\031.google.protobuf.Duratio" + + "n\022\014\n\004word\030\003 \001(\t\022\022\n\nconfidence\030\004 \001(\002\022\030\n\013s" + + "peaker_tag\030\005 \001(\005B\003\340A\0032\202\005\n\006Speech\022\245\001\n\tRec" + + "ognize\022/.google.cloud.speech.v1p1beta1.R" + + "ecognizeRequest\0320.google.cloud.speech.v1" + + "p1beta1.RecognizeResponse\"5\202\323\344\223\002 \"\033/v1p1" + + "beta1/speech:recognize:\001*\332A\014config,audio" + + "\022\362\001\n\024LongRunningRecognize\022:.google.cloud" + + ".speech.v1p1beta1.LongRunningRecognizeRe" + + "quest\032\035.google.longrunning.Operation\"\177\202\323" + + "\344\223\002+\"&/v1p1beta1/speech:longrunningrecog" + + "nize:\001*\332A\014config,audio\312A<\n\034LongRunningRe" + + "cognizeResponse\022\034LongRunningRecognizeMet" + + "adata\022\217\001\n\022StreamingRecognize\0228.google.cl" + + "oud.speech.v1p1beta1.StreamingRecognizeR" + + "equest\0329.google.cloud.speech.v1p1beta1.S" + + "treamingRecognizeResponse\"\000(\0010\001\032I\312A\025spee" + + "ch.googleapis.com\322A.https://www.googleap" + + "is.com/auth/cloud-platformB\200\001\n!com.googl" + + "e.cloud.speech.v1p1beta1B\013SpeechProtoP\001Z" + + "Cgoogle.golang.org/genproto/googleapis/c" + + "loud/speech/v1p1beta1;speech\370\001\001\242\002\003GCSb\006p" + + "roto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -387,7 +392,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor, new java.lang.String[] { - "Results", + "Results", "OutputConfig", "OutputError", }); internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor = getDescriptor().getMessageTypes().get(12); @@ -395,7 +400,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor, new java.lang.String[] { - "ProgressPercent", "StartTime", "LastUpdateTime", "Uri", + "ProgressPercent", "StartTime", "LastUpdateTime", "Uri", "OutputConfig", }); internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor = getDescriptor().getMessageTypes().get(13); diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto b/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto index 0fcea916b..9a8e256f0 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto +++ b/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto @@ -638,6 +638,12 @@ message LongRunningRecognizeResponse { // Sequential list of transcription results corresponding to // sequential portions of audio. repeated SpeechRecognitionResult results = 2; + + // Original output config if present in the request. + TranscriptOutputConfig output_config = 6; + + // If the transcript output fails this field contains the relevant error. + google.rpc.Status output_error = 7; } // Describes the progress of a long-running `LongRunningRecognize` call. It is @@ -657,6 +663,9 @@ message LongRunningRecognizeMetadata { // Output only. The URI of the audio file being transcribed. Empty if the audio was sent // as byte content. string uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A copy of the TranscriptOutputConfig if it was set in the request. + TranscriptOutputConfig output_config = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; } // `StreamingRecognizeResponse` is the only message returned to the client by diff --git a/synth.metadata b/synth.metadata index 8f7af0098..113e0ebe4 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,23 +4,23 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-speech.git", - "sha": "98dae49de8d86f6f96fc2707e77010886f3e1881" + "sha": "5ad0d367715e59e3565ce62f5edb546047492dda" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b6ebac16c3aecb798d4f25443d96df2f42a965ca", - "internalRef": "362294447" + "sha": "72326861be446be27d53af95c87e6e313367c371", + "internalRef": "362934100" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b6ebac16c3aecb798d4f25443d96df2f42a965ca", - "internalRef": "362294447" + "sha": "72326861be446be27d53af95c87e6e313367c371", + "internalRef": "362934100" } }, {