From 0605e06847c08e8f22a1052dea3e68298b12856a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 15:36:25 +0000 Subject: [PATCH] chore(bazel): update protobuf to v3.21.7 (#721) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 477955264 Source-Link: https://togithub.com/googleapis/googleapis/commit/a724450af76d0001f23602684c49cd6a4b3a5654 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/4abcbcaec855e74a0b22a4988cf9e0eb61a83094 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGFiY2JjYWVjODU1ZTc0YTBiMjJhNDk4OGNmOWUwZWI2MWE4MzA5NCJ9 --- .../StreamingTranslateSpeechConfig.java | 136 ++++----- .../StreamingTranslateSpeechRequest.java | 147 ++++------ .../StreamingTranslateSpeechResponse.java | 160 ++++------- .../StreamingTranslateSpeechResult.java | 267 +++++++----------- .../v1beta1/TranslateSpeechConfig.java | 164 +++++------ 5 files changed, 332 insertions(+), 542 deletions(-) diff --git a/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/StreamingTranslateSpeechConfig.java b/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/StreamingTranslateSpeechConfig.java index 837b5f3fa8b0..e06f6607ac01 100644 --- a/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/StreamingTranslateSpeechConfig.java +++ b/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/StreamingTranslateSpeechConfig.java @@ -51,68 +51,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private StreamingTranslateSpeechConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.Builder subBuilder = - null; - if (audioConfig_ != null) { - subBuilder = audioConfig_.toBuilder(); - } - audioConfig_ = - input.readMessage( - com.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(audioConfig_); - audioConfig_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - singleUtterance_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.mediatranslation.v1beta1.MediaTranslationProto .internal_static_google_cloud_mediatranslation_v1beta1_StreamingTranslateSpeechConfig_descriptor; @@ -233,7 +171,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (singleUtterance_ != false) { output.writeBool(2, singleUtterance_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -248,7 +186,7 @@ public int getSerializedSize() { if (singleUtterance_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, singleUtterance_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -270,7 +208,7 @@ public boolean equals(final java.lang.Object obj) { if (!getAudioConfig().equals(other.getAudioConfig())) return false; } if (getSingleUtterance() != other.getSingleUtterance()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -287,7 +225,7 @@ public int hashCode() { } hash = (37 * hash) + SINGLE_UTTERANCE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSingleUtterance()); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -420,17 +358,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -540,7 +471,7 @@ public Builder mergeFrom( if (other.getSingleUtterance() != false) { setSingleUtterance(other.getSingleUtterance()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -555,19 +486,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getAudioConfigFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 16: + { + singleUtterance_ = input.readBool(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -903,7 +858,18 @@ public StreamingTranslateSpeechConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingTranslateSpeechConfig(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/StreamingTranslateSpeechRequest.java b/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/StreamingTranslateSpeechRequest.java index 41cbdd3be44e..2ac6441fe282 100644 --- a/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/StreamingTranslateSpeechRequest.java +++ b/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/StreamingTranslateSpeechRequest.java @@ -55,75 +55,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private StreamingTranslateSpeechRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig.Builder - subBuilder = null; - if (streamingRequestCase_ == 1) { - subBuilder = - ((com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig) - streamingRequest_) - .toBuilder(); - } - streamingRequest_ = - input.readMessage( - com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig - .parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig) - streamingRequest_); - streamingRequest_ = subBuilder.buildPartial(); - } - streamingRequestCase_ = 1; - break; - } - case 18: - { - streamingRequest_ = input.readBytes(); - streamingRequestCase_ = 2; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.mediatranslation.v1beta1.MediaTranslationProto .internal_static_google_cloud_mediatranslation_v1beta1_StreamingTranslateSpeechRequest_descriptor; @@ -328,7 +259,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (streamingRequestCase_ == 2) { output.writeBytes(2, (com.google.protobuf.ByteString) streamingRequest_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -349,7 +280,7 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeBytesSize( 2, (com.google.protobuf.ByteString) streamingRequest_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -377,7 +308,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -400,7 +331,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -537,22 +468,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + if (streamingConfigBuilder_ != null) { + streamingConfigBuilder_.clear(); + } streamingRequestCase_ = 0; streamingRequest_ = null; return this; @@ -667,7 +594,7 @@ public Builder mergeFrom( break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -682,20 +609,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest parsedMessage = - null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getStreamingConfigFieldBuilder().getBuilder(), extensionRegistry); + streamingRequestCase_ = 1; + break; + } // case 10 + case 18: + { + streamingRequest_ = input.readBytes(); + streamingRequestCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1111,7 +1061,18 @@ public StreamingTranslateSpeechRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingTranslateSpeechRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/StreamingTranslateSpeechResponse.java b/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/StreamingTranslateSpeechResponse.java index adb1972dca99..440c8c2af2bd 100644 --- a/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/StreamingTranslateSpeechResponse.java +++ b/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/StreamingTranslateSpeechResponse.java @@ -54,85 +54,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private StreamingTranslateSpeechResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.rpc.Status.Builder subBuilder = null; - if (error_ != null) { - subBuilder = error_.toBuilder(); - } - error_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(error_); - error_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.Builder - subBuilder = null; - if (result_ != null) { - subBuilder = result_.toBuilder(); - } - result_ = - input.readMessage( - com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult - .parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(result_); - result_ = subBuilder.buildPartial(); - } - - break; - } - case 24: - { - int rawValue = input.readEnum(); - - speechEventType_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.mediatranslation.v1beta1.MediaTranslationProto .internal_static_google_cloud_mediatranslation_v1beta1_StreamingTranslateSpeechResponse_descriptor; @@ -488,7 +409,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(3, speechEventType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -509,7 +430,7 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, speechEventType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -535,7 +456,7 @@ public boolean equals(final java.lang.Object obj) { if (!getResult().equals(other.getResult())) return false; } if (speechEventType_ != other.speechEventType_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -556,7 +477,7 @@ public int hashCode() { } hash = (37 * hash) + SPEECH_EVENT_TYPE_FIELD_NUMBER; hash = (53 * hash) + speechEventType_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -695,17 +616,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -830,7 +744,7 @@ public Builder mergeFrom( if (other.speechEventType_ != 0) { setSpeechEventTypeValue(other.getSpeechEventTypeValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -845,20 +759,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse parsedMessage = - null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getErrorFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getResultFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 24: + { + speechEventType_ = input.readEnum(); + + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1410,7 +1353,18 @@ public StreamingTranslateSpeechResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingTranslateSpeechResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/StreamingTranslateSpeechResult.java b/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/StreamingTranslateSpeechResult.java index 44bc584314a4..4c1d2c628cba 100644 --- a/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/StreamingTranslateSpeechResult.java +++ b/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/StreamingTranslateSpeechResult.java @@ -52,72 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private StreamingTranslateSpeechResult( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult - .TextTranslationResult.Builder - subBuilder = null; - if (resultCase_ == 1) { - subBuilder = - ((com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult - .TextTranslationResult) - result_) - .toBuilder(); - } - result_ = - input.readMessage( - com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult - .TextTranslationResult.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult - .TextTranslationResult) - result_); - result_ = subBuilder.buildPartial(); - } - resultCase_ = 1; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.mediatranslation.v1beta1.MediaTranslationProto .internal_static_google_cloud_mediatranslation_v1beta1_StreamingTranslateSpeechResult_descriptor; @@ -216,57 +150,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private TextTranslationResult( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - translation_ = s; - break; - } - case 16: - { - isFinal_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.mediatranslation.v1beta1.MediaTranslationProto .internal_static_google_cloud_mediatranslation_v1beta1_StreamingTranslateSpeechResult_TextTranslationResult_descriptor; @@ -376,7 +259,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (isFinal_ != false) { output.writeBool(2, isFinal_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -391,7 +274,7 @@ public int getSerializedSize() { if (isFinal_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, isFinal_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -415,7 +298,7 @@ public boolean equals(final java.lang.Object obj) { if (!getTranslation().equals(other.getTranslation())) return false; if (getIsFinal() != other.getIsFinal()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -430,7 +313,7 @@ public int hashCode() { hash = (53 * hash) + getTranslation().hashCode(); hash = (37 * hash) + IS_FINAL_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsFinal()); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -587,17 +470,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -717,7 +593,7 @@ public Builder mergeFrom( if (other.getIsFinal() != false) { setIsFinal(other.getIsFinal()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -732,22 +608,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult - .TextTranslationResult - parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + translation_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + isFinal_ = input.readBool(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult - .TextTranslationResult) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -963,7 +860,19 @@ public TextTranslationResult parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TextTranslationResult(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -1116,7 +1025,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .TextTranslationResult) result_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1133,7 +1042,7 @@ public int getSerializedSize() { .TextTranslationResult) result_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1158,7 +1067,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1177,7 +1086,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1311,22 +1220,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + if (textTranslationResultBuilder_ != null) { + textTranslationResultBuilder_.clear(); + } resultCase_ = 0; result_ = null; return this; @@ -1432,7 +1337,7 @@ public Builder mergeFrom( break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1447,19 +1352,38 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getTextTranslationResultFieldBuilder().getBuilder(), extensionRegistry); + resultCase_ = 1; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1779,7 +1703,18 @@ public StreamingTranslateSpeechResult parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingTranslateSpeechResult(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/TranslateSpeechConfig.java b/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/TranslateSpeechConfig.java index 4f1701a786ec..bca4bc78bb8d 100644 --- a/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/TranslateSpeechConfig.java +++ b/java-mediatranslation/proto-google-cloud-mediatranslation-v1beta1/src/main/java/com/google/cloud/mediatranslation/v1beta1/TranslateSpeechConfig.java @@ -56,78 +56,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private TranslateSpeechConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - audioEncoding_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - sourceLanguageCode_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - targetLanguageCode_ = s; - break; - } - case 32: - { - sampleRateHertz_ = input.readInt32(); - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - - model_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.mediatranslation.v1beta1.MediaTranslationProto .internal_static_google_cloud_mediatranslation_v1beta1_TranslateSpeechConfig_descriptor; @@ -435,7 +363,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, model_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -459,7 +387,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, model_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -480,7 +408,7 @@ public boolean equals(final java.lang.Object obj) { if (!getTargetLanguageCode().equals(other.getTargetLanguageCode())) return false; if (getSampleRateHertz() != other.getSampleRateHertz()) return false; if (!getModel().equals(other.getModel())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -501,7 +429,7 @@ public int hashCode() { hash = (53 * hash) + getSampleRateHertz(); hash = (37 * hash) + MODEL_FIELD_NUMBER; hash = (53 * hash) + getModel().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -632,17 +560,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -762,7 +683,7 @@ public Builder mergeFrom( model_ = other.model_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -777,19 +698,61 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + audioEncoding_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + sourceLanguageCode_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + targetLanguageCode_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 32: + { + sampleRateHertz_ = input.readInt32(); + + break; + } // case 32 + case 42: + { + model_ = input.readStringRequireUtf8(); + + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1427,7 +1390,18 @@ public TranslateSpeechConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TranslateSpeechConfig(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } };