From ce098c0e78d4715125ef6d0eaf89f8d5451873dd 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 19:44:15 +0000 Subject: [PATCH] chore(bazel): update protobuf to v3.21.7 (#800) - [ ] 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 --- .../iot/v1/BindDeviceToGatewayRequest.java | 139 +++--- .../iot/v1/BindDeviceToGatewayResponse.java | 100 ++-- .../iot/v1/CreateDeviceRegistryRequest.java | 135 ++---- .../cloud/iot/v1/CreateDeviceRequest.java | 133 ++---- .../iot/v1/DeleteDeviceRegistryRequest.java | 113 ++--- .../cloud/iot/v1/DeleteDeviceRequest.java | 112 ++--- .../java/com/google/cloud/iot/v1/Device.java | 435 +++++++----------- .../com/google/cloud/iot/v1/DeviceConfig.java | 163 +++---- .../google/cloud/iot/v1/DeviceCredential.java | 146 +++--- .../google/cloud/iot/v1/DeviceRegistry.java | 271 +++++------ .../com/google/cloud/iot/v1/DeviceState.java | 131 ++---- .../cloud/iot/v1/EventNotificationConfig.java | 125 ++--- .../google/cloud/iot/v1/GatewayConfig.java | 160 +++---- .../cloud/iot/v1/GatewayListOptions.java | 141 +++--- .../iot/v1/GetDeviceRegistryRequest.java | 112 ++--- .../google/cloud/iot/v1/GetDeviceRequest.java | 133 ++---- .../com/google/cloud/iot/v1/HttpConfig.java | 112 ++--- .../v1/ListDeviceConfigVersionsRequest.java | 124 ++--- .../v1/ListDeviceConfigVersionsResponse.java | 133 +++--- .../iot/v1/ListDeviceRegistriesRequest.java | 137 +++--- .../iot/v1/ListDeviceRegistriesResponse.java | 147 +++--- .../cloud/iot/v1/ListDeviceStatesRequest.java | 123 ++--- .../iot/v1/ListDeviceStatesResponse.java | 132 +++--- .../cloud/iot/v1/ListDevicesRequest.java | 245 ++++------ .../cloud/iot/v1/ListDevicesResponse.java | 143 +++--- .../v1/ModifyCloudToDeviceConfigRequest.java | 135 +++--- .../com/google/cloud/iot/v1/MqttConfig.java | 112 ++--- .../cloud/iot/v1/PublicKeyCertificate.java | 147 +++--- .../cloud/iot/v1/PublicKeyCredential.java | 125 ++--- .../cloud/iot/v1/RegistryCredential.java | 126 ++--- .../iot/v1/SendCommandToDeviceRequest.java | 137 +++--- .../iot/v1/SendCommandToDeviceResponse.java | 100 ++-- .../cloud/iot/v1/StateNotificationConfig.java | 112 ++--- .../v1/UnbindDeviceFromGatewayRequest.java | 139 +++--- .../v1/UnbindDeviceFromGatewayResponse.java | 100 ++-- .../iot/v1/UpdateDeviceRegistryRequest.java | 143 ++---- .../cloud/iot/v1/UpdateDeviceRequest.java | 141 ++---- .../cloud/iot/v1/X509CertificateDetails.java | 193 +++----- 38 files changed, 2191 insertions(+), 3364 deletions(-) diff --git a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/BindDeviceToGatewayRequest.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/BindDeviceToGatewayRequest.java index 572703bf062e..d1c9eb8aed52 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/BindDeviceToGatewayRequest.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/BindDeviceToGatewayRequest.java @@ -54,66 +54,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private BindDeviceToGatewayRequest( - 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(); - - parent_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - gatewayId_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - deviceId_ = 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_BindDeviceToGatewayRequest_descriptor; @@ -311,7 +251,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, deviceId_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -329,7 +269,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, deviceId_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -348,7 +288,7 @@ public boolean equals(final java.lang.Object obj) { if (!getParent().equals(other.getParent())) return false; if (!getGatewayId().equals(other.getGatewayId())) return false; if (!getDeviceId().equals(other.getDeviceId())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -365,7 +305,7 @@ public int hashCode() { hash = (53 * hash) + getGatewayId().hashCode(); hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; hash = (53 * hash) + getDeviceId().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -494,17 +434,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.BindDeviceToGatewayRequest.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 @@ -608,7 +541,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.BindDeviceToGatewayRequest othe deviceId_ = other.deviceId_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -623,18 +556,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.BindDeviceToGatewayRequest 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: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + gatewayId_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + deviceId_ = input.readStringRequireUtf8(); + + break; + } // case 26 + 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.iot.v1.BindDeviceToGatewayRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1018,7 +982,18 @@ public BindDeviceToGatewayRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new BindDeviceToGatewayRequest(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/BindDeviceToGatewayResponse.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/BindDeviceToGatewayResponse.java index 40602ac10062..1702fecdcc71 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/BindDeviceToGatewayResponse.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/BindDeviceToGatewayResponse.java @@ -50,45 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private BindDeviceToGatewayResponse( - 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; - 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_BindDeviceToGatewayResponse_descriptor; @@ -118,7 +79,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -127,7 +88,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -143,7 +104,7 @@ public boolean equals(final java.lang.Object obj) { com.google.cloud.iot.v1.BindDeviceToGatewayResponse other = (com.google.cloud.iot.v1.BindDeviceToGatewayResponse) obj; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -154,7 +115,7 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -283,17 +244,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.BindDeviceToGatewayResponse.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 @@ -376,7 +330,7 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.cloud.iot.v1.BindDeviceToGatewayResponse other) { if (other == com.google.cloud.iot.v1.BindDeviceToGatewayResponse.getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -391,18 +345,31 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.BindDeviceToGatewayResponse 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; + 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.iot.v1.BindDeviceToGatewayResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -438,7 +405,18 @@ public BindDeviceToGatewayResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new BindDeviceToGatewayResponse(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/CreateDeviceRegistryRequest.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/CreateDeviceRegistryRequest.java index edc2adb15085..04602b03bc6e 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/CreateDeviceRegistryRequest.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/CreateDeviceRegistryRequest.java @@ -52,68 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private CreateDeviceRegistryRequest( - 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(); - - parent_ = s; - break; - } - case 18: - { - com.google.cloud.iot.v1.DeviceRegistry.Builder subBuilder = null; - if (deviceRegistry_ != null) { - subBuilder = deviceRegistry_.toBuilder(); - } - deviceRegistry_ = - input.readMessage( - com.google.cloud.iot.v1.DeviceRegistry.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(deviceRegistry_); - deviceRegistry_ = subBuilder.buildPartial(); - } - - 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_CreateDeviceRegistryRequest_descriptor; @@ -264,7 +202,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (deviceRegistry_ != null) { output.writeMessage(2, getDeviceRegistry()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -279,7 +217,7 @@ public int getSerializedSize() { if (deviceRegistry_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDeviceRegistry()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -300,7 +238,7 @@ public boolean equals(final java.lang.Object obj) { if (hasDeviceRegistry()) { if (!getDeviceRegistry().equals(other.getDeviceRegistry())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -317,7 +255,7 @@ public int hashCode() { hash = (37 * hash) + DEVICE_REGISTRY_FIELD_NUMBER; hash = (53 * hash) + getDeviceRegistry().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -446,17 +384,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.CreateDeviceRegistryRequest.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 @@ -560,7 +491,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.CreateDeviceRegistryRequest oth if (other.hasDeviceRegistry()) { mergeDeviceRegistry(other.getDeviceRegistry()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -575,18 +506,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.CreateDeviceRegistryRequest 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: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getDeviceRegistryFieldBuilder().getBuilder(), extensionRegistry); + + 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.iot.v1.CreateDeviceRegistryRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -965,7 +921,18 @@ public CreateDeviceRegistryRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateDeviceRegistryRequest(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/CreateDeviceRequest.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/CreateDeviceRequest.java index 1de4defdcaa8..6a16af627bbf 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/CreateDeviceRequest.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/CreateDeviceRequest.java @@ -52,67 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private CreateDeviceRequest( - 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(); - - parent_ = s; - break; - } - case 18: - { - com.google.cloud.iot.v1.Device.Builder subBuilder = null; - if (device_ != null) { - subBuilder = device_.toBuilder(); - } - device_ = - input.readMessage(com.google.cloud.iot.v1.Device.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(device_); - device_ = subBuilder.buildPartial(); - } - - 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_CreateDeviceRequest_descriptor; @@ -257,7 +196,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (device_ != null) { output.writeMessage(2, getDevice()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -272,7 +211,7 @@ public int getSerializedSize() { if (device_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDevice()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -293,7 +232,7 @@ public boolean equals(final java.lang.Object obj) { if (hasDevice()) { if (!getDevice().equals(other.getDevice())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -310,7 +249,7 @@ public int hashCode() { hash = (37 * hash) + DEVICE_FIELD_NUMBER; hash = (53 * hash) + getDevice().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -439,17 +378,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.CreateDeviceRequest.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 @@ -552,7 +484,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.CreateDeviceRequest other) { if (other.hasDevice()) { mergeDevice(other.getDevice()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -567,17 +499,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.CreateDeviceRequest 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: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getDeviceFieldBuilder().getBuilder(), extensionRegistry); + + 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.iot.v1.CreateDeviceRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -945,7 +903,18 @@ public CreateDeviceRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateDeviceRequest(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeleteDeviceRegistryRequest.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeleteDeviceRegistryRequest.java index a07e32afb766..12901f233caf 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeleteDeviceRegistryRequest.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeleteDeviceRegistryRequest.java @@ -52,52 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private DeleteDeviceRegistryRequest( - 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(); - - name_ = 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_DeleteDeviceRegistryRequest_descriptor; @@ -185,7 +139,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -197,7 +151,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -214,7 +168,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.iot.v1.DeleteDeviceRegistryRequest) obj; if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -227,7 +181,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -356,17 +310,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.DeleteDeviceRegistryRequest.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 @@ -456,7 +403,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.DeleteDeviceRegistryRequest oth name_ = other.name_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -471,18 +418,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.DeleteDeviceRegistryRequest 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: + { + name_ = input.readStringRequireUtf8(); + + 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.iot.v1.DeleteDeviceRegistryRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -639,7 +605,18 @@ public DeleteDeviceRegistryRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteDeviceRegistryRequest(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeleteDeviceRequest.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeleteDeviceRequest.java index 6bf41a45b2d7..33a078fc1a59 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeleteDeviceRequest.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeleteDeviceRequest.java @@ -52,52 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private DeleteDeviceRequest( - 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(); - - name_ = 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_DeleteDeviceRequest_descriptor; @@ -187,7 +141,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -199,7 +153,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -216,7 +170,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.iot.v1.DeleteDeviceRequest) obj; if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -229,7 +183,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -358,17 +312,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.DeleteDeviceRequest.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 @@ -457,7 +404,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.DeleteDeviceRequest other) { name_ = other.name_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -472,17 +419,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.DeleteDeviceRequest 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: + { + name_ = input.readStringRequireUtf8(); + + 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.iot.v1.DeleteDeviceRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -644,7 +611,18 @@ public DeleteDeviceRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteDeviceRequest(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/Device.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/Device.java index 89348c1098e2..1d37e7c25952 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/Device.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/Device.java @@ -55,259 +55,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Device( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - 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(); - - id_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 24: - { - numId_ = input.readUInt64(); - break; - } - case 58: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (lastHeartbeatTime_ != null) { - subBuilder = lastHeartbeatTime_.toBuilder(); - } - lastHeartbeatTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lastHeartbeatTime_); - lastHeartbeatTime_ = subBuilder.buildPartial(); - } - - break; - } - case 66: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (lastEventTime_ != null) { - subBuilder = lastEventTime_.toBuilder(); - } - lastEventTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lastEventTime_); - lastEventTime_ = subBuilder.buildPartial(); - } - - break; - } - case 82: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (lastErrorTime_ != null) { - subBuilder = lastErrorTime_.toBuilder(); - } - lastErrorTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lastErrorTime_); - lastErrorTime_ = subBuilder.buildPartial(); - } - - break; - } - case 90: - { - com.google.rpc.Status.Builder subBuilder = null; - if (lastErrorStatus_ != null) { - subBuilder = lastErrorStatus_.toBuilder(); - } - lastErrorStatus_ = - input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lastErrorStatus_); - lastErrorStatus_ = subBuilder.buildPartial(); - } - - break; - } - case 98: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - credentials_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - credentials_.add( - input.readMessage( - com.google.cloud.iot.v1.DeviceCredential.parser(), extensionRegistry)); - break; - } - case 106: - { - com.google.cloud.iot.v1.DeviceConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = - input.readMessage( - com.google.cloud.iot.v1.DeviceConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - case 114: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (lastConfigAckTime_ != null) { - subBuilder = lastConfigAckTime_.toBuilder(); - } - lastConfigAckTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lastConfigAckTime_); - lastConfigAckTime_ = subBuilder.buildPartial(); - } - - break; - } - case 130: - { - com.google.cloud.iot.v1.DeviceState.Builder subBuilder = null; - if (state_ != null) { - subBuilder = state_.toBuilder(); - } - state_ = - input.readMessage( - com.google.cloud.iot.v1.DeviceState.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(state_); - state_ = subBuilder.buildPartial(); - } - - break; - } - case 138: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - metadata_ = - com.google.protobuf.MapField.newMapField( - MetadataDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry metadata__ = - input.readMessage( - MetadataDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - metadata_.getMutableMap().put(metadata__.getKey(), metadata__.getValue()); - break; - } - case 146: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (lastConfigSendTime_ != null) { - subBuilder = lastConfigSendTime_.toBuilder(); - } - lastConfigSendTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lastConfigSendTime_); - lastConfigSendTime_ = subBuilder.buildPartial(); - } - - break; - } - case 152: - { - blocked_ = input.readBool(); - break; - } - case 162: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (lastStateTime_ != null) { - subBuilder = lastStateTime_.toBuilder(); - } - lastStateTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lastStateTime_); - lastStateTime_ = subBuilder.buildPartial(); - } - - break; - } - case 168: - { - int rawValue = input.readEnum(); - - logLevel_ = rawValue; - break; - } - case 194: - { - com.google.cloud.iot.v1.GatewayConfig.Builder subBuilder = null; - if (gatewayConfig_ != null) { - subBuilder = gatewayConfig_.toBuilder(); - } - gatewayConfig_ = - input.readMessage( - com.google.cloud.iot.v1.GatewayConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(gatewayConfig_); - gatewayConfig_ = subBuilder.buildPartial(); - } - - 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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - credentials_ = java.util.Collections.unmodifiableList(credentials_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.iot.v1.ResourcesProto .internal_static_google_cloud_iot_v1_Device_descriptor; @@ -1348,7 +1095,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (gatewayConfig_ != null) { output.writeMessage(24, getGatewayConfig()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1415,7 +1162,7 @@ public int getSerializedSize() { if (gatewayConfig_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(24, getGatewayConfig()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1477,7 +1224,7 @@ public boolean equals(final java.lang.Object obj) { if (hasGatewayConfig()) { if (!getGatewayConfig().equals(other.getGatewayConfig())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1546,7 +1293,7 @@ public int hashCode() { hash = (37 * hash) + GATEWAY_CONFIG_FIELD_NUMBER; hash = (53 * hash) + getGatewayConfig().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1693,19 +1440,10 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } // Construct using com.google.cloud.iot.v1.Device.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) { - getCredentialsFieldBuilder(); - } } @java.lang.Override @@ -1719,10 +1457,11 @@ public Builder clear() { if (credentialsBuilder_ == null) { credentials_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + credentials_ = null; credentialsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); if (lastHeartbeatTimeBuilder_ == null) { lastHeartbeatTime_ = null; } else { @@ -2005,7 +1744,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.Device other) { if (other.hasGatewayConfig()) { mergeGatewayConfig(other.getGatewayConfig()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -2020,17 +1759,148 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.Device 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: + { + id_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 24: + { + numId_ = input.readUInt64(); + + break; + } // case 24 + case 58: + { + input.readMessage( + getLastHeartbeatTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 58 + case 66: + { + input.readMessage(getLastEventTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 66 + case 82: + { + input.readMessage(getLastErrorTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 82 + case 90: + { + input.readMessage(getLastErrorStatusFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 90 + case 98: + { + com.google.cloud.iot.v1.DeviceCredential m = + input.readMessage( + com.google.cloud.iot.v1.DeviceCredential.parser(), extensionRegistry); + if (credentialsBuilder_ == null) { + ensureCredentialsIsMutable(); + credentials_.add(m); + } else { + credentialsBuilder_.addMessage(m); + } + break; + } // case 98 + case 106: + { + input.readMessage(getConfigFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 106 + case 114: + { + input.readMessage( + getLastConfigAckTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 114 + case 130: + { + input.readMessage(getStateFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 130 + case 138: + { + com.google.protobuf.MapEntry metadata__ = + input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableMetadata() + .getMutableMap() + .put(metadata__.getKey(), metadata__.getValue()); + break; + } // case 138 + case 146: + { + input.readMessage( + getLastConfigSendTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 146 + case 152: + { + blocked_ = input.readBool(); + + break; + } // case 152 + case 162: + { + input.readMessage(getLastStateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 162 + case 168: + { + logLevel_ = input.readEnum(); + + break; + } // case 168 + case 194: + { + input.readMessage(getGatewayConfigFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 194 + 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.iot.v1.Device) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -5212,7 +5082,18 @@ public Device parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Device(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeviceConfig.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeviceConfig.java index 81b811425811..5d440635e037 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeviceConfig.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeviceConfig.java @@ -52,85 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private DeviceConfig( - 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 8: - { - version_ = input.readInt64(); - break; - } - case 18: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (cloudUpdateTime_ != null) { - subBuilder = cloudUpdateTime_.toBuilder(); - } - cloudUpdateTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(cloudUpdateTime_); - cloudUpdateTime_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (deviceAckTime_ != null) { - subBuilder = deviceAckTime_.toBuilder(); - } - deviceAckTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(deviceAckTime_); - deviceAckTime_ = subBuilder.buildPartial(); - } - - break; - } - case 34: - { - binaryData_ = input.readBytes(); - 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.iot.v1.ResourcesProto .internal_static_google_cloud_iot_v1_DeviceConfig_descriptor; @@ -334,7 +255,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!binaryData_.isEmpty()) { output.writeBytes(4, binaryData_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -355,7 +276,7 @@ public int getSerializedSize() { if (!binaryData_.isEmpty()) { size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, binaryData_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -380,7 +301,7 @@ public boolean equals(final java.lang.Object obj) { if (!getDeviceAckTime().equals(other.getDeviceAckTime())) return false; } if (!getBinaryData().equals(other.getBinaryData())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -403,7 +324,7 @@ public int hashCode() { } hash = (37 * hash) + BINARY_DATA_FIELD_NUMBER; hash = (53 * hash) + getBinaryData().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -531,17 +452,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.DeviceConfig.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 @@ -662,7 +576,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.DeviceConfig other) { if (other.getBinaryData() != com.google.protobuf.ByteString.EMPTY) { setBinaryData(other.getBinaryData()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -677,17 +591,55 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.DeviceConfig 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 8: + { + version_ = input.readInt64(); + + break; + } // case 8 + case 18: + { + input.readMessage(getCloudUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getDeviceAckTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 34: + { + binaryData_ = input.readBytes(); + + break; + } // case 34 + 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.iot.v1.DeviceConfig) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1290,7 +1242,18 @@ public DeviceConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceConfig(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeviceCredential.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeviceCredential.java index 13fac30130a3..34be7d7fd2cb 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeviceCredential.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeviceCredential.java @@ -50,77 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private DeviceCredential( - 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 18: - { - com.google.cloud.iot.v1.PublicKeyCredential.Builder subBuilder = null; - if (credentialCase_ == 2) { - subBuilder = - ((com.google.cloud.iot.v1.PublicKeyCredential) credential_).toBuilder(); - } - credential_ = - input.readMessage( - com.google.cloud.iot.v1.PublicKeyCredential.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.cloud.iot.v1.PublicKeyCredential) credential_); - credential_ = subBuilder.buildPartial(); - } - credentialCase_ = 2; - break; - } - case 50: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (expirationTime_ != null) { - subBuilder = expirationTime_.toBuilder(); - } - expirationTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(expirationTime_); - expirationTime_ = subBuilder.buildPartial(); - } - - 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.iot.v1.ResourcesProto .internal_static_google_cloud_iot_v1_DeviceCredential_descriptor; @@ -335,7 +264,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (expirationTime_ != null) { output.writeMessage(6, getExpirationTime()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -352,7 +281,7 @@ public int getSerializedSize() { if (expirationTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getExpirationTime()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -379,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; } @@ -402,7 +331,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -531,22 +460,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.DeviceCredential.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 (publicKeyBuilder_ != null) { + publicKeyBuilder_.clear(); + } if (expirationTimeBuilder_ == null) { expirationTime_ = null; } else { @@ -658,7 +583,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.DeviceCredential other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -673,17 +598,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.DeviceCredential 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 18: + { + input.readMessage(getPublicKeyFieldBuilder().getBuilder(), extensionRegistry); + credentialCase_ = 2; + break; + } // case 18 + case 50: + { + input.readMessage(getExpirationTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + 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.iot.v1.DeviceCredential) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1236,7 +1187,18 @@ public DeviceCredential parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceCredential(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeviceRegistry.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeviceRegistry.java index 7f79e37f3668..734cab5f21b6 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeviceRegistry.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeviceRegistry.java @@ -56,144 +56,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private DeviceRegistry( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - 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(); - - id_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 34: - { - com.google.cloud.iot.v1.MqttConfig.Builder subBuilder = null; - if (mqttConfig_ != null) { - subBuilder = mqttConfig_.toBuilder(); - } - mqttConfig_ = - input.readMessage(com.google.cloud.iot.v1.MqttConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(mqttConfig_); - mqttConfig_ = subBuilder.buildPartial(); - } - - break; - } - case 58: - { - com.google.cloud.iot.v1.StateNotificationConfig.Builder subBuilder = null; - if (stateNotificationConfig_ != null) { - subBuilder = stateNotificationConfig_.toBuilder(); - } - stateNotificationConfig_ = - input.readMessage( - com.google.cloud.iot.v1.StateNotificationConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(stateNotificationConfig_); - stateNotificationConfig_ = subBuilder.buildPartial(); - } - - break; - } - case 66: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - credentials_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - credentials_.add( - input.readMessage( - com.google.cloud.iot.v1.RegistryCredential.parser(), extensionRegistry)); - break; - } - case 74: - { - com.google.cloud.iot.v1.HttpConfig.Builder subBuilder = null; - if (httpConfig_ != null) { - subBuilder = httpConfig_.toBuilder(); - } - httpConfig_ = - input.readMessage(com.google.cloud.iot.v1.HttpConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(httpConfig_); - httpConfig_ = subBuilder.buildPartial(); - } - - break; - } - case 82: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - eventNotificationConfigs_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - eventNotificationConfigs_.add( - input.readMessage( - com.google.cloud.iot.v1.EventNotificationConfig.parser(), extensionRegistry)); - break; - } - case 88: - { - int rawValue = input.readEnum(); - - logLevel_ = 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 { - if (((mutable_bitField0_ & 0x00000002) != 0)) { - credentials_ = java.util.Collections.unmodifiableList(credentials_); - } - if (((mutable_bitField0_ & 0x00000001) != 0)) { - eventNotificationConfigs_ = - java.util.Collections.unmodifiableList(eventNotificationConfigs_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.iot.v1.ResourcesProto .internal_static_google_cloud_iot_v1_DeviceRegistry_descriptor; @@ -776,7 +638,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (logLevel_ != com.google.cloud.iot.v1.LogLevel.LOG_LEVEL_UNSPECIFIED.getNumber()) { output.writeEnum(11, logLevel_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -812,7 +674,7 @@ public int getSerializedSize() { if (logLevel_ != com.google.cloud.iot.v1.LogLevel.LOG_LEVEL_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, logLevel_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -845,7 +707,7 @@ public boolean equals(final java.lang.Object obj) { } if (logLevel_ != other.logLevel_) return false; if (!getCredentialsList().equals(other.getCredentialsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -882,7 +744,7 @@ public int hashCode() { hash = (37 * hash) + CREDENTIALS_FIELD_NUMBER; hash = (53 * hash) + getCredentialsList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1011,20 +873,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.DeviceRegistry.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) { - getEventNotificationConfigsFieldBuilder(); - getCredentialsFieldBuilder(); - } } @java.lang.Override @@ -1036,10 +888,11 @@ public Builder clear() { if (eventNotificationConfigsBuilder_ == null) { eventNotificationConfigs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + eventNotificationConfigs_ = null; eventNotificationConfigsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); if (stateNotificationConfigBuilder_ == null) { stateNotificationConfig_ = null; } else { @@ -1062,10 +915,11 @@ public Builder clear() { if (credentialsBuilder_ == null) { credentials_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); } else { + credentials_ = null; credentialsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); return this; } @@ -1254,7 +1108,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.DeviceRegistry other) { } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1269,17 +1123,95 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.DeviceRegistry 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: + { + id_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 34: + { + input.readMessage(getMqttConfigFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 34 + case 58: + { + input.readMessage( + getStateNotificationConfigFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 58 + case 66: + { + com.google.cloud.iot.v1.RegistryCredential m = + input.readMessage( + com.google.cloud.iot.v1.RegistryCredential.parser(), extensionRegistry); + if (credentialsBuilder_ == null) { + ensureCredentialsIsMutable(); + credentials_.add(m); + } else { + credentialsBuilder_.addMessage(m); + } + break; + } // case 66 + case 74: + { + input.readMessage(getHttpConfigFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 74 + case 82: + { + com.google.cloud.iot.v1.EventNotificationConfig m = + input.readMessage( + com.google.cloud.iot.v1.EventNotificationConfig.parser(), + extensionRegistry); + if (eventNotificationConfigsBuilder_ == null) { + ensureEventNotificationConfigsIsMutable(); + eventNotificationConfigs_.add(m); + } else { + eventNotificationConfigsBuilder_.addMessage(m); + } + break; + } // case 82 + case 88: + { + logLevel_ = input.readEnum(); + + break; + } // case 88 + 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.iot.v1.DeviceRegistry) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -3277,7 +3209,18 @@ public DeviceRegistry parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceRegistry(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeviceState.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeviceState.java index 5614b4bd9671..3a201467e8b1 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeviceState.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/DeviceState.java @@ -52,65 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private DeviceState( - 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.protobuf.Timestamp.Builder subBuilder = null; - if (updateTime_ != null) { - subBuilder = updateTime_.toBuilder(); - } - updateTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateTime_); - updateTime_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - binaryData_ = input.readBytes(); - 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.iot.v1.ResourcesProto .internal_static_google_cloud_iot_v1_DeviceState_descriptor; @@ -213,7 +154,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!binaryData_.isEmpty()) { output.writeBytes(2, binaryData_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -228,7 +169,7 @@ public int getSerializedSize() { if (!binaryData_.isEmpty()) { size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, binaryData_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -248,7 +189,7 @@ public boolean equals(final java.lang.Object obj) { if (!getUpdateTime().equals(other.getUpdateTime())) return false; } if (!getBinaryData().equals(other.getBinaryData())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -265,7 +206,7 @@ public int hashCode() { } hash = (37 * hash) + BINARY_DATA_FIELD_NUMBER; hash = (53 * hash) + getBinaryData().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -393,17 +334,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.DeviceState.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 @@ -504,7 +438,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.DeviceState other) { if (other.getBinaryData() != com.google.protobuf.ByteString.EMPTY) { setBinaryData(other.getBinaryData()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -519,17 +453,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.DeviceState 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(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + binaryData_ = input.readBytes(); + + 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.iot.v1.DeviceState) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -812,7 +772,18 @@ public DeviceState parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceState(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/EventNotificationConfig.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/EventNotificationConfig.java index d3a66188e343..7a32aa03de68 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/EventNotificationConfig.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/EventNotificationConfig.java @@ -53,59 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private EventNotificationConfig( - 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(); - - pubsubTopicName_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - subfolderMatches_ = 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.iot.v1.ResourcesProto .internal_static_google_cloud_iot_v1_EventNotificationConfig_descriptor; @@ -247,7 +194,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subfolderMatches_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, subfolderMatches_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -262,7 +209,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subfolderMatches_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, subfolderMatches_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -280,7 +227,7 @@ public boolean equals(final java.lang.Object obj) { if (!getSubfolderMatches().equals(other.getSubfolderMatches())) return false; if (!getPubsubTopicName().equals(other.getPubsubTopicName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -295,7 +242,7 @@ public int hashCode() { hash = (53 * hash) + getSubfolderMatches().hashCode(); hash = (37 * hash) + PUBSUB_TOPIC_NAME_FIELD_NUMBER; hash = (53 * hash) + getPubsubTopicName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -424,17 +371,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.EventNotificationConfig.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 @@ -531,7 +471,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.EventNotificationConfig other) pubsubTopicName_ = other.pubsubTopicName_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -546,17 +486,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.EventNotificationConfig 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: + { + pubsubTopicName_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + subfolderMatches_ = input.readStringRequireUtf8(); + + 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.iot.v1.EventNotificationConfig) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -824,7 +790,18 @@ public EventNotificationConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new EventNotificationConfig(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/GatewayConfig.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/GatewayConfig.java index cae89af6144b..7bbc38f41c40 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/GatewayConfig.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/GatewayConfig.java @@ -54,81 +54,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private GatewayConfig( - 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 8: - { - int rawValue = input.readEnum(); - - gatewayType_ = rawValue; - break; - } - case 16: - { - int rawValue = input.readEnum(); - - gatewayAuthMethod_ = rawValue; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - lastAccessedGatewayId_ = s; - break; - } - case 34: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (lastAccessedGatewayTime_ != null) { - subBuilder = lastAccessedGatewayTime_.toBuilder(); - } - lastAccessedGatewayTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lastAccessedGatewayTime_); - lastAccessedGatewayTime_ = subBuilder.buildPartial(); - } - - 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.iot.v1.ResourcesProto .internal_static_google_cloud_iot_v1_GatewayConfig_descriptor; @@ -345,7 +270,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (lastAccessedGatewayTime_ != null) { output.writeMessage(4, getLastAccessedGatewayTime()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -368,7 +293,7 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getLastAccessedGatewayTime()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -390,7 +315,7 @@ public boolean equals(final java.lang.Object obj) { if (hasLastAccessedGatewayTime()) { if (!getLastAccessedGatewayTime().equals(other.getLastAccessedGatewayTime())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -411,7 +336,7 @@ public int hashCode() { hash = (37 * hash) + LAST_ACCESSED_GATEWAY_TIME_FIELD_NUMBER; hash = (53 * hash) + getLastAccessedGatewayTime().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -539,17 +464,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.GatewayConfig.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 @@ -664,7 +582,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.GatewayConfig other) { if (other.hasLastAccessedGatewayTime()) { mergeLastAccessedGatewayTime(other.getLastAccessedGatewayTime()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -679,17 +597,56 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.GatewayConfig 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 8: + { + gatewayType_ = input.readEnum(); + + break; + } // case 8 + case 16: + { + gatewayAuthMethod_ = input.readEnum(); + + break; + } // case 16 + case 26: + { + lastAccessedGatewayId_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 34: + { + input.readMessage( + getLastAccessedGatewayTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 34 + 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.iot.v1.GatewayConfig) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1213,7 +1170,18 @@ public GatewayConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new GatewayConfig(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/GatewayListOptions.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/GatewayListOptions.java index 8a9dceef6d58..6a97e87dce0b 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/GatewayListOptions.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/GatewayListOptions.java @@ -50,66 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private GatewayListOptions( - 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 8: - { - int rawValue = input.readEnum(); - filterCase_ = 1; - filter_ = rawValue; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - filterCase_ = 2; - filter_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - filterCase_ = 3; - filter_ = 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_GatewayListOptions_descriptor; @@ -415,7 +355,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (filterCase_ == 3) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, filter_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -434,7 +374,7 @@ public int getSerializedSize() { if (filterCase_ == 3) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, filter_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -464,7 +404,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; } @@ -491,7 +431,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -620,17 +560,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.GatewayListOptions.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 @@ -749,7 +682,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.GatewayListOptions other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -764,17 +697,52 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.GatewayListOptions 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 8: + { + int rawValue = input.readEnum(); + filterCase_ = 1; + filter_ = rawValue; + break; + } // case 8 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + filterCase_ = 2; + filter_ = s; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + filterCase_ = 3; + filter_ = s; + break; + } // case 26 + 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.iot.v1.GatewayListOptions) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1253,7 +1221,18 @@ public GatewayListOptions parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new GatewayListOptions(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/GetDeviceRegistryRequest.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/GetDeviceRegistryRequest.java index 6fa2086d74f9..6169b8c824b5 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/GetDeviceRegistryRequest.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/GetDeviceRegistryRequest.java @@ -52,52 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private GetDeviceRegistryRequest( - 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(); - - name_ = 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_GetDeviceRegistryRequest_descriptor; @@ -185,7 +139,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -197,7 +151,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -214,7 +168,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.iot.v1.GetDeviceRegistryRequest) obj; if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -227,7 +181,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -356,17 +310,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.GetDeviceRegistryRequest.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 @@ -456,7 +403,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.GetDeviceRegistryRequest other) name_ = other.name_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -471,17 +418,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.GetDeviceRegistryRequest 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: + { + name_ = input.readStringRequireUtf8(); + + 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.iot.v1.GetDeviceRegistryRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -638,7 +605,18 @@ public GetDeviceRegistryRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new GetDeviceRegistryRequest(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/GetDeviceRequest.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/GetDeviceRequest.java index d4b8683fa4d6..6e4976440fa5 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/GetDeviceRequest.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/GetDeviceRequest.java @@ -52,67 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private GetDeviceRequest( - 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(); - - name_ = s; - break; - } - case 18: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (fieldMask_ != null) { - subBuilder = fieldMask_.toBuilder(); - } - fieldMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(fieldMask_); - fieldMask_ = subBuilder.buildPartial(); - } - - 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_GetDeviceRequest_descriptor; @@ -257,7 +196,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (fieldMask_ != null) { output.writeMessage(2, getFieldMask()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -272,7 +211,7 @@ public int getSerializedSize() { if (fieldMask_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFieldMask()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -292,7 +231,7 @@ public boolean equals(final java.lang.Object obj) { if (hasFieldMask()) { if (!getFieldMask().equals(other.getFieldMask())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -309,7 +248,7 @@ public int hashCode() { hash = (37 * hash) + FIELD_MASK_FIELD_NUMBER; hash = (53 * hash) + getFieldMask().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -438,17 +377,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.GetDeviceRequest.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 @@ -551,7 +483,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.GetDeviceRequest other) { if (other.hasFieldMask()) { mergeFieldMask(other.getFieldMask()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -566,17 +498,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.GetDeviceRequest 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: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getFieldMaskFieldBuilder().getBuilder(), extensionRegistry); + + 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.iot.v1.GetDeviceRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -935,7 +893,18 @@ public GetDeviceRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new GetDeviceRequest(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/HttpConfig.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/HttpConfig.java index e483859905ef..3de1ec0158dd 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/HttpConfig.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/HttpConfig.java @@ -52,52 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private HttpConfig( - 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 8: - { - int rawValue = input.readEnum(); - - httpEnabledState_ = 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.iot.v1.ResourcesProto .internal_static_google_cloud_iot_v1_HttpConfig_descriptor; @@ -168,7 +122,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (httpEnabledState_ != com.google.cloud.iot.v1.HttpState.HTTP_STATE_UNSPECIFIED.getNumber()) { output.writeEnum(1, httpEnabledState_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -180,7 +134,7 @@ public int getSerializedSize() { if (httpEnabledState_ != com.google.cloud.iot.v1.HttpState.HTTP_STATE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, httpEnabledState_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -196,7 +150,7 @@ public boolean equals(final java.lang.Object obj) { com.google.cloud.iot.v1.HttpConfig other = (com.google.cloud.iot.v1.HttpConfig) obj; if (httpEnabledState_ != other.httpEnabledState_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -209,7 +163,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + HTTP_ENABLED_STATE_FIELD_NUMBER; hash = (53 * hash) + httpEnabledState_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -337,17 +291,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.HttpConfig.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 @@ -434,7 +381,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.HttpConfig other) { if (other.httpEnabledState_ != 0) { setHttpEnabledStateValue(other.getHttpEnabledStateValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -449,17 +396,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.HttpConfig 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 8: + { + httpEnabledState_ = input.readEnum(); + + break; + } // case 8 + 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.iot.v1.HttpConfig) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -591,7 +558,18 @@ public HttpConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new HttpConfig(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceConfigVersionsRequest.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceConfigVersionsRequest.java index 7a691015ebc9..aec376a1b95a 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceConfigVersionsRequest.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceConfigVersionsRequest.java @@ -53,57 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ListDeviceConfigVersionsRequest( - 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(); - - name_ = s; - break; - } - case 16: - { - numVersions_ = input.readInt32(); - 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_ListDeviceConfigVersionsRequest_descriptor; @@ -216,7 +165,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (numVersions_ != 0) { output.writeInt32(2, numVersions_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -231,7 +180,7 @@ public int getSerializedSize() { if (numVersions_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, numVersions_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -249,7 +198,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (getNumVersions() != other.getNumVersions()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -264,7 +213,7 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + NUM_VERSIONS_FIELD_NUMBER; hash = (53 * hash) + getNumVersions(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -394,17 +343,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.ListDeviceConfigVersionsRequest.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 @@ -500,7 +442,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.ListDeviceConfigVersionsRequest if (other.getNumVersions() != 0) { setNumVersions(other.getNumVersions()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -515,18 +457,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.ListDeviceConfigVersionsRequest 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: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + numVersions_ = input.readInt32(); + + 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.iot.v1.ListDeviceConfigVersionsRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -746,7 +713,18 @@ public ListDeviceConfigVersionsRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListDeviceConfigVersionsRequest(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceConfigVersionsResponse.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceConfigVersionsResponse.java index 0d894e24d0e5..4efe80a665b2 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceConfigVersionsResponse.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceConfigVersionsResponse.java @@ -53,60 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ListDeviceConfigVersionsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - 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: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - deviceConfigs_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - deviceConfigs_.add( - input.readMessage( - com.google.cloud.iot.v1.DeviceConfig.parser(), extensionRegistry)); - 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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - deviceConfigs_ = java.util.Collections.unmodifiableList(deviceConfigs_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_ListDeviceConfigVersionsResponse_descriptor; @@ -213,7 +159,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < deviceConfigs_.size(); i++) { output.writeMessage(1, deviceConfigs_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -225,7 +171,7 @@ public int getSerializedSize() { for (int i = 0; i < deviceConfigs_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, deviceConfigs_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -242,7 +188,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.iot.v1.ListDeviceConfigVersionsResponse) obj; if (!getDeviceConfigsList().equals(other.getDeviceConfigsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -257,7 +203,7 @@ public int hashCode() { hash = (37 * hash) + DEVICE_CONFIGS_FIELD_NUMBER; hash = (53 * hash) + getDeviceConfigsList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -387,19 +333,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.ListDeviceConfigVersionsResponse.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) { - getDeviceConfigsFieldBuilder(); - } } @java.lang.Override @@ -407,10 +344,11 @@ public Builder clear() { super.clear(); if (deviceConfigsBuilder_ == null) { deviceConfigs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + deviceConfigs_ = null; deviceConfigsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -525,7 +463,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.ListDeviceConfigVersionsRespons } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -540,18 +478,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.ListDeviceConfigVersionsResponse 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: + { + com.google.cloud.iot.v1.DeviceConfig m = + input.readMessage( + com.google.cloud.iot.v1.DeviceConfig.parser(), extensionRegistry); + if (deviceConfigsBuilder_ == null) { + ensureDeviceConfigsIsMutable(); + deviceConfigs_.add(m); + } else { + deviceConfigsBuilder_.addMessage(m); + } + 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.iot.v1.ListDeviceConfigVersionsResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -960,7 +924,18 @@ public ListDeviceConfigVersionsResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListDeviceConfigVersionsResponse(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceRegistriesRequest.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceRegistriesRequest.java index 749a3848b53a..31ea44d5a978 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceRegistriesRequest.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceRegistriesRequest.java @@ -53,64 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ListDeviceRegistriesRequest( - 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(); - - parent_ = s; - break; - } - case 16: - { - pageSize_ = input.readInt32(); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_ListDeviceRegistriesRequest_descriptor; @@ -278,7 +220,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -296,7 +238,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -315,7 +257,7 @@ public boolean equals(final java.lang.Object obj) { if (!getParent().equals(other.getParent())) return false; if (getPageSize() != other.getPageSize()) return false; if (!getPageToken().equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -332,7 +274,7 @@ public int hashCode() { hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -461,17 +403,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.ListDeviceRegistriesRequest.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 @@ -574,7 +509,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.ListDeviceRegistriesRequest oth pageToken_ = other.pageToken_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -589,18 +524,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.ListDeviceRegistriesRequest 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: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 26 + 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.iot.v1.ListDeviceRegistriesRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -934,7 +900,18 @@ public ListDeviceRegistriesRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListDeviceRegistriesRequest(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceRegistriesResponse.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceRegistriesResponse.java index e6bd3272457d..9223567366b7 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceRegistriesResponse.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceRegistriesResponse.java @@ -53,68 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ListDeviceRegistriesResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - 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: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - deviceRegistries_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - deviceRegistries_.add( - input.readMessage( - com.google.cloud.iot.v1.DeviceRegistry.parser(), extensionRegistry)); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = 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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - deviceRegistries_ = java.util.Collections.unmodifiableList(deviceRegistries_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_ListDeviceRegistriesResponse_descriptor; @@ -272,7 +210,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -287,7 +225,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -305,7 +243,7 @@ public boolean equals(final java.lang.Object obj) { if (!getDeviceRegistriesList().equals(other.getDeviceRegistriesList())) return false; if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -322,7 +260,7 @@ public int hashCode() { } hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -451,19 +389,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.ListDeviceRegistriesResponse.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) { - getDeviceRegistriesFieldBuilder(); - } } @java.lang.Override @@ -471,10 +400,11 @@ public Builder clear() { super.clear(); if (deviceRegistriesBuilder_ == null) { deviceRegistries_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + deviceRegistries_ = null; deviceRegistriesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); nextPageToken_ = ""; return this; @@ -596,7 +526,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.ListDeviceRegistriesResponse ot nextPageToken_ = other.nextPageToken_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -611,18 +541,50 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.ListDeviceRegistriesResponse 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: + { + com.google.cloud.iot.v1.DeviceRegistry m = + input.readMessage( + com.google.cloud.iot.v1.DeviceRegistry.parser(), extensionRegistry); + if (deviceRegistriesBuilder_ == null) { + ensureDeviceRegistriesIsMutable(); + deviceRegistries_.add(m); + } else { + deviceRegistriesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + 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.iot.v1.ListDeviceRegistriesResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1130,7 +1092,18 @@ public ListDeviceRegistriesResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListDeviceRegistriesResponse(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceStatesRequest.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceStatesRequest.java index cae14f96d96b..99c59c1da2c9 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceStatesRequest.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceStatesRequest.java @@ -52,57 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ListDeviceStatesRequest( - 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(); - - name_ = s; - break; - } - case 16: - { - numStates_ = input.readInt32(); - 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_ListDeviceStatesRequest_descriptor; @@ -215,7 +164,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (numStates_ != 0) { output.writeInt32(2, numStates_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -230,7 +179,7 @@ public int getSerializedSize() { if (numStates_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, numStates_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -248,7 +197,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (getNumStates() != other.getNumStates()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -263,7 +212,7 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + NUM_STATES_FIELD_NUMBER; hash = (53 * hash) + getNumStates(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -392,17 +341,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.ListDeviceStatesRequest.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 @@ -498,7 +440,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.ListDeviceStatesRequest other) if (other.getNumStates() != 0) { setNumStates(other.getNumStates()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -513,17 +455,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.ListDeviceStatesRequest 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: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + numStates_ = input.readInt32(); + + 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.iot.v1.ListDeviceStatesRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -743,7 +711,18 @@ public ListDeviceStatesRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListDeviceStatesRequest(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceStatesResponse.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceStatesResponse.java index be6ed6db997b..522b6fe53fdf 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceStatesResponse.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDeviceStatesResponse.java @@ -52,60 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ListDeviceStatesResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - 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: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - deviceStates_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - deviceStates_.add( - input.readMessage( - com.google.cloud.iot.v1.DeviceState.parser(), extensionRegistry)); - 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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - deviceStates_ = java.util.Collections.unmodifiableList(deviceStates_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_ListDeviceStatesResponse_descriptor; @@ -212,7 +158,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < deviceStates_.size(); i++) { output.writeMessage(1, deviceStates_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -224,7 +170,7 @@ public int getSerializedSize() { for (int i = 0; i < deviceStates_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, deviceStates_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -241,7 +187,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.iot.v1.ListDeviceStatesResponse) obj; if (!getDeviceStatesList().equals(other.getDeviceStatesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -256,7 +202,7 @@ public int hashCode() { hash = (37 * hash) + DEVICE_STATES_FIELD_NUMBER; hash = (53 * hash) + getDeviceStatesList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -385,19 +331,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.ListDeviceStatesResponse.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) { - getDeviceStatesFieldBuilder(); - } } @java.lang.Override @@ -405,10 +342,11 @@ public Builder clear() { super.clear(); if (deviceStatesBuilder_ == null) { deviceStates_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + deviceStates_ = null; deviceStatesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -523,7 +461,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.ListDeviceStatesResponse other) } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -538,17 +476,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.ListDeviceStatesResponse 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: + { + com.google.cloud.iot.v1.DeviceState m = + input.readMessage( + com.google.cloud.iot.v1.DeviceState.parser(), extensionRegistry); + if (deviceStatesBuilder_ == null) { + ensureDeviceStatesIsMutable(); + deviceStates_.add(m); + } else { + deviceStatesBuilder_.addMessage(m); + } + 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.iot.v1.ListDeviceStatesResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -953,7 +918,18 @@ public ListDeviceStatesResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListDeviceStatesResponse(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDevicesRequest.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDevicesRequest.java index 75a79aeb8714..15030a4fda75 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDevicesRequest.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDevicesRequest.java @@ -55,135 +55,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ListDevicesRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - 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(); - - parent_ = s; - break; - } - case 16: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - deviceNumIds_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - deviceNumIds_.addLong(input.readUInt64()); - break; - } - case 18: - { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - deviceNumIds_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - deviceNumIds_.addLong(input.readUInt64()); - } - input.popLimit(limit); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - deviceIds_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - deviceIds_.add(s); - break; - } - case 34: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (fieldMask_ != null) { - subBuilder = fieldMask_.toBuilder(); - } - fieldMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(fieldMask_); - fieldMask_ = subBuilder.buildPartial(); - } - - break; - } - case 50: - { - com.google.cloud.iot.v1.GatewayListOptions.Builder subBuilder = null; - if (gatewayListOptions_ != null) { - subBuilder = gatewayListOptions_.toBuilder(); - } - gatewayListOptions_ = - input.readMessage( - com.google.cloud.iot.v1.GatewayListOptions.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(gatewayListOptions_); - gatewayListOptions_ = subBuilder.buildPartial(); - } - - break; - } - case 800: - { - pageSize_ = input.readInt32(); - break; - } - case 810: - { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = 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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - deviceNumIds_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - deviceIds_ = deviceIds_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_ListDevicesRequest_descriptor; @@ -588,7 +459,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 101, pageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -633,7 +504,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(101, pageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -662,7 +533,7 @@ public boolean equals(final java.lang.Object obj) { } if (getPageSize() != other.getPageSize()) return false; if (!getPageToken().equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -695,7 +566,7 @@ public int hashCode() { hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -824,17 +695,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.ListDevicesRequest.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 @@ -999,7 +863,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.ListDevicesRequest other) { pageToken_ = other.pageToken_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1014,17 +878,87 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.ListDevicesRequest 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: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + long v = input.readUInt64(); + ensureDeviceNumIdsIsMutable(); + deviceNumIds_.addLong(v); + break; + } // case 16 + case 18: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureDeviceNumIdsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + deviceNumIds_.addLong(input.readUInt64()); + } + input.popLimit(limit); + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDeviceIdsIsMutable(); + deviceIds_.add(s); + break; + } // case 26 + case 34: + { + input.readMessage(getFieldMaskFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 34 + case 50: + { + input.readMessage( + getGatewayListOptionsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + case 800: + { + pageSize_ = input.readInt32(); + + break; + } // case 800 + case 810: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 810 + 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.iot.v1.ListDevicesRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -2062,7 +1996,18 @@ public ListDevicesRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListDevicesRequest(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDevicesResponse.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDevicesResponse.java index 6a04a182854f..89b41bebb898 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDevicesResponse.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ListDevicesResponse.java @@ -53,66 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ListDevicesResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - 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: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - devices_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - devices_.add( - input.readMessage(com.google.cloud.iot.v1.Device.parser(), extensionRegistry)); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = 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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - devices_ = java.util.Collections.unmodifiableList(devices_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_ListDevicesResponse_descriptor; @@ -268,7 +208,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -283,7 +223,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -301,7 +241,7 @@ public boolean equals(final java.lang.Object obj) { if (!getDevicesList().equals(other.getDevicesList())) return false; if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -318,7 +258,7 @@ public int hashCode() { } hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -447,19 +387,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.ListDevicesResponse.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) { - getDevicesFieldBuilder(); - } } @java.lang.Override @@ -467,10 +398,11 @@ public Builder clear() { super.clear(); if (devicesBuilder_ == null) { devices_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + devices_ = null; devicesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); nextPageToken_ = ""; return this; @@ -591,7 +523,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.ListDevicesResponse other) { nextPageToken_ = other.nextPageToken_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -606,17 +538,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.ListDevicesResponse 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: + { + com.google.cloud.iot.v1.Device m = + input.readMessage(com.google.cloud.iot.v1.Device.parser(), extensionRegistry); + if (devicesBuilder_ == null) { + ensureDevicesIsMutable(); + devices_.add(m); + } else { + devicesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + 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.iot.v1.ListDevicesResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1111,7 +1075,18 @@ public ListDevicesResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListDevicesResponse(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ModifyCloudToDeviceConfigRequest.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ModifyCloudToDeviceConfigRequest.java index 1fa6fbcca640..80fa2131af43 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ModifyCloudToDeviceConfigRequest.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/ModifyCloudToDeviceConfigRequest.java @@ -54,62 +54,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ModifyCloudToDeviceConfigRequest( - 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(); - - name_ = s; - break; - } - case 16: - { - versionToUpdate_ = input.readInt64(); - break; - } - case 26: - { - binaryData_ = input.readBytes(); - 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_ModifyCloudToDeviceConfigRequest_descriptor; @@ -245,7 +189,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!binaryData_.isEmpty()) { output.writeBytes(3, binaryData_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -263,7 +207,7 @@ public int getSerializedSize() { if (!binaryData_.isEmpty()) { size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, binaryData_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -282,7 +226,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (getVersionToUpdate() != other.getVersionToUpdate()) return false; if (!getBinaryData().equals(other.getBinaryData())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -299,7 +243,7 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getVersionToUpdate()); hash = (37 * hash) + BINARY_DATA_FIELD_NUMBER; hash = (53 * hash) + getBinaryData().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -429,17 +373,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest.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 @@ -541,7 +478,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.ModifyCloudToDeviceConfigReques if (other.getBinaryData() != com.google.protobuf.ByteString.EMPTY) { setBinaryData(other.getBinaryData()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -556,18 +493,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest 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: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + versionToUpdate_ = input.readInt64(); + + break; + } // case 16 + case 26: + { + binaryData_ = input.readBytes(); + + break; + } // case 26 + 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.iot.v1.ModifyCloudToDeviceConfigRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -848,7 +816,18 @@ public ModifyCloudToDeviceConfigRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ModifyCloudToDeviceConfigRequest(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/MqttConfig.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/MqttConfig.java index 1d206754022f..5a8cac34320a 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/MqttConfig.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/MqttConfig.java @@ -52,52 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private MqttConfig( - 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 8: - { - int rawValue = input.readEnum(); - - mqttEnabledState_ = 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.iot.v1.ResourcesProto .internal_static_google_cloud_iot_v1_MqttConfig_descriptor; @@ -168,7 +122,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (mqttEnabledState_ != com.google.cloud.iot.v1.MqttState.MQTT_STATE_UNSPECIFIED.getNumber()) { output.writeEnum(1, mqttEnabledState_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -180,7 +134,7 @@ public int getSerializedSize() { if (mqttEnabledState_ != com.google.cloud.iot.v1.MqttState.MQTT_STATE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mqttEnabledState_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -196,7 +150,7 @@ public boolean equals(final java.lang.Object obj) { com.google.cloud.iot.v1.MqttConfig other = (com.google.cloud.iot.v1.MqttConfig) obj; if (mqttEnabledState_ != other.mqttEnabledState_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -209,7 +163,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + MQTT_ENABLED_STATE_FIELD_NUMBER; hash = (53 * hash) + mqttEnabledState_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -337,17 +291,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.MqttConfig.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 @@ -434,7 +381,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.MqttConfig other) { if (other.mqttEnabledState_ != 0) { setMqttEnabledStateValue(other.getMqttEnabledStateValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -449,17 +396,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.MqttConfig 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 8: + { + mqttEnabledState_ = input.readEnum(); + + break; + } // case 8 + 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.iot.v1.MqttConfig) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -591,7 +558,18 @@ public MqttConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new MqttConfig(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/PublicKeyCertificate.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/PublicKeyCertificate.java index 5247291e4a04..bb750045be60 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/PublicKeyCertificate.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/PublicKeyCertificate.java @@ -53,75 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private PublicKeyCertificate( - 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 8: - { - int rawValue = input.readEnum(); - - format_ = rawValue; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - certificate_ = s; - break; - } - case 26: - { - com.google.cloud.iot.v1.X509CertificateDetails.Builder subBuilder = null; - if (x509Details_ != null) { - subBuilder = x509Details_.toBuilder(); - } - x509Details_ = - input.readMessage( - com.google.cloud.iot.v1.X509CertificateDetails.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(x509Details_); - x509Details_ = subBuilder.buildPartial(); - } - - 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.iot.v1.ResourcesProto .internal_static_google_cloud_iot_v1_PublicKeyCertificate_descriptor; @@ -298,7 +229,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (x509Details_ != null) { output.writeMessage(3, getX509Details()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -319,7 +250,7 @@ public int getSerializedSize() { if (x509Details_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getX509Details()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -341,7 +272,7 @@ public boolean equals(final java.lang.Object obj) { if (hasX509Details()) { if (!getX509Details().equals(other.getX509Details())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -360,7 +291,7 @@ public int hashCode() { hash = (37 * hash) + X509_DETAILS_FIELD_NUMBER; hash = (53 * hash) + getX509Details().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -489,17 +420,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.PublicKeyCertificate.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 @@ -608,7 +532,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.PublicKeyCertificate other) { if (other.hasX509Details()) { mergeX509Details(other.getX509Details()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -623,17 +547,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.PublicKeyCertificate 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 8: + { + format_ = input.readEnum(); + + break; + } // case 8 + case 18: + { + certificate_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + input.readMessage(getX509DetailsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + 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.iot.v1.PublicKeyCertificate) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1054,7 +1010,18 @@ public PublicKeyCertificate parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PublicKeyCertificate(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/PublicKeyCredential.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/PublicKeyCredential.java index 453a641db228..708e4842d939 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/PublicKeyCredential.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/PublicKeyCredential.java @@ -53,59 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private PublicKeyCredential( - 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 8: - { - int rawValue = input.readEnum(); - - format_ = rawValue; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - key_ = 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.iot.v1.ResourcesProto .internal_static_google_cloud_iot_v1_PublicKeyCredential_descriptor; @@ -227,7 +174,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, key_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -243,7 +190,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, key_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -261,7 +208,7 @@ public boolean equals(final java.lang.Object obj) { if (format_ != other.format_) return false; if (!getKey().equals(other.getKey())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -276,7 +223,7 @@ public int hashCode() { hash = (53 * hash) + format_; hash = (37 * hash) + KEY_FIELD_NUMBER; hash = (53 * hash) + getKey().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -405,17 +352,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.PublicKeyCredential.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 @@ -510,7 +450,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.PublicKeyCredential other) { key_ = other.key_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -525,17 +465,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.PublicKeyCredential 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 8: + { + format_ = input.readEnum(); + + break; + } // case 8 + case 18: + { + key_ = input.readStringRequireUtf8(); + + 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.iot.v1.PublicKeyCredential) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -768,7 +734,18 @@ public PublicKeyCredential parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PublicKeyCredential(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/RegistryCredential.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/RegistryCredential.java index 214329e22b73..bc019c1609fd 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/RegistryCredential.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/RegistryCredential.java @@ -50,62 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private RegistryCredential( - 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.iot.v1.PublicKeyCertificate.Builder subBuilder = null; - if (credentialCase_ == 1) { - subBuilder = - ((com.google.cloud.iot.v1.PublicKeyCertificate) credential_).toBuilder(); - } - credential_ = - input.readMessage( - com.google.cloud.iot.v1.PublicKeyCertificate.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.cloud.iot.v1.PublicKeyCertificate) credential_); - credential_ = subBuilder.buildPartial(); - } - credentialCase_ = 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.iot.v1.ResourcesProto .internal_static_google_cloud_iot_v1_RegistryCredential_descriptor; @@ -233,7 +177,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (credentialCase_ == 1) { output.writeMessage(1, (com.google.cloud.iot.v1.PublicKeyCertificate) credential_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -247,7 +191,7 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 1, (com.google.cloud.iot.v1.PublicKeyCertificate) credential_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -271,7 +215,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; } @@ -290,7 +234,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -419,22 +363,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.RegistryCredential.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 (publicKeyCertificateBuilder_ != null) { + publicKeyCertificateBuilder_.clear(); + } credentialCase_ = 0; credential_ = null; return this; @@ -532,7 +472,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.RegistryCredential other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -547,17 +487,38 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.RegistryCredential 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( + getPublicKeyCertificateFieldBuilder().getBuilder(), extensionRegistry); + credentialCase_ = 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.iot.v1.RegistryCredential) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -818,7 +779,18 @@ public RegistryCredential parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new RegistryCredential(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/SendCommandToDeviceRequest.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/SendCommandToDeviceRequest.java index e17619f51af6..026783f85553 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/SendCommandToDeviceRequest.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/SendCommandToDeviceRequest.java @@ -54,64 +54,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private SendCommandToDeviceRequest( - 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(); - - name_ = s; - break; - } - case 18: - { - binaryData_ = input.readBytes(); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - subfolder_ = 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_SendCommandToDeviceRequest_descriptor; @@ -282,7 +224,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subfolder_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, subfolder_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -300,7 +242,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subfolder_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, subfolder_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -319,7 +261,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (!getBinaryData().equals(other.getBinaryData())) return false; if (!getSubfolder().equals(other.getSubfolder())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -336,7 +278,7 @@ public int hashCode() { hash = (53 * hash) + getBinaryData().hashCode(); hash = (37 * hash) + SUBFOLDER_FIELD_NUMBER; hash = (53 * hash) + getSubfolder().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -465,17 +407,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.SendCommandToDeviceRequest.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 @@ -578,7 +513,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.SendCommandToDeviceRequest othe subfolder_ = other.subfolder_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -593,18 +528,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.SendCommandToDeviceRequest 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: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + binaryData_ = input.readBytes(); + + break; + } // case 18 + case 26: + { + subfolder_ = input.readStringRequireUtf8(); + + break; + } // case 26 + 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.iot.v1.SendCommandToDeviceRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -947,7 +913,18 @@ public SendCommandToDeviceRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new SendCommandToDeviceRequest(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/SendCommandToDeviceResponse.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/SendCommandToDeviceResponse.java index 093d57018cc6..9ef82605c61e 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/SendCommandToDeviceResponse.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/SendCommandToDeviceResponse.java @@ -50,45 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private SendCommandToDeviceResponse( - 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; - 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_SendCommandToDeviceResponse_descriptor; @@ -118,7 +79,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -127,7 +88,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -143,7 +104,7 @@ public boolean equals(final java.lang.Object obj) { com.google.cloud.iot.v1.SendCommandToDeviceResponse other = (com.google.cloud.iot.v1.SendCommandToDeviceResponse) obj; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -154,7 +115,7 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -283,17 +244,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.SendCommandToDeviceResponse.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 @@ -376,7 +330,7 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.cloud.iot.v1.SendCommandToDeviceResponse other) { if (other == com.google.cloud.iot.v1.SendCommandToDeviceResponse.getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -391,18 +345,31 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.SendCommandToDeviceResponse 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; + 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.iot.v1.SendCommandToDeviceResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -438,7 +405,18 @@ public SendCommandToDeviceResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new SendCommandToDeviceResponse(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/StateNotificationConfig.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/StateNotificationConfig.java index e6defab5bdd9..b18bffaece40 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/StateNotificationConfig.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/StateNotificationConfig.java @@ -52,52 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private StateNotificationConfig( - 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(); - - pubsubTopicName_ = 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.iot.v1.ResourcesProto .internal_static_google_cloud_iot_v1_StateNotificationConfig_descriptor; @@ -181,7 +135,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pubsubTopicName_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pubsubTopicName_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -193,7 +147,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pubsubTopicName_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pubsubTopicName_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -210,7 +164,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.iot.v1.StateNotificationConfig) obj; if (!getPubsubTopicName().equals(other.getPubsubTopicName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -223,7 +177,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PUBSUB_TOPIC_NAME_FIELD_NUMBER; hash = (53 * hash) + getPubsubTopicName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -352,17 +306,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.StateNotificationConfig.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 @@ -452,7 +399,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.StateNotificationConfig other) pubsubTopicName_ = other.pubsubTopicName_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -467,17 +414,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.StateNotificationConfig 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: + { + pubsubTopicName_ = input.readStringRequireUtf8(); + + 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.iot.v1.StateNotificationConfig) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -624,7 +591,18 @@ public StateNotificationConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new StateNotificationConfig(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/UnbindDeviceFromGatewayRequest.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/UnbindDeviceFromGatewayRequest.java index a7ab50fdfa84..b79319d0a499 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/UnbindDeviceFromGatewayRequest.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/UnbindDeviceFromGatewayRequest.java @@ -55,66 +55,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private UnbindDeviceFromGatewayRequest( - 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(); - - parent_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - gatewayId_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - deviceId_ = 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_UnbindDeviceFromGatewayRequest_descriptor; @@ -312,7 +252,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, deviceId_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -330,7 +270,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, deviceId_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -349,7 +289,7 @@ public boolean equals(final java.lang.Object obj) { if (!getParent().equals(other.getParent())) return false; if (!getGatewayId().equals(other.getGatewayId())) return false; if (!getDeviceId().equals(other.getDeviceId())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -366,7 +306,7 @@ public int hashCode() { hash = (53 * hash) + getGatewayId().hashCode(); hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; hash = (53 * hash) + getDeviceId().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -496,17 +436,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest.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 @@ -610,7 +543,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest deviceId_ = other.deviceId_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -625,18 +558,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest 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: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + gatewayId_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + deviceId_ = input.readStringRequireUtf8(); + + break; + } // case 26 + 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.iot.v1.UnbindDeviceFromGatewayRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1020,7 +984,18 @@ public UnbindDeviceFromGatewayRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new UnbindDeviceFromGatewayRequest(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/UnbindDeviceFromGatewayResponse.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/UnbindDeviceFromGatewayResponse.java index f8535dc771f5..2567e43e7bab 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/UnbindDeviceFromGatewayResponse.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/UnbindDeviceFromGatewayResponse.java @@ -51,45 +51,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private UnbindDeviceFromGatewayResponse( - 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; - 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_UnbindDeviceFromGatewayResponse_descriptor; @@ -119,7 +80,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -128,7 +89,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -144,7 +105,7 @@ public boolean equals(final java.lang.Object obj) { com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse other = (com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse) obj; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -155,7 +116,7 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -285,17 +246,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse.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 @@ -378,7 +332,7 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse other) { if (other == com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse.getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -393,18 +347,31 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse 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; + 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.iot.v1.UnbindDeviceFromGatewayResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -440,7 +407,18 @@ public UnbindDeviceFromGatewayResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new UnbindDeviceFromGatewayResponse(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/UpdateDeviceRegistryRequest.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/UpdateDeviceRegistryRequest.java index 2621725f84d8..5ea316202596 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/UpdateDeviceRegistryRequest.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/UpdateDeviceRegistryRequest.java @@ -50,76 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private UpdateDeviceRegistryRequest( - 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.iot.v1.DeviceRegistry.Builder subBuilder = null; - if (deviceRegistry_ != null) { - subBuilder = deviceRegistry_.toBuilder(); - } - deviceRegistry_ = - input.readMessage( - com.google.cloud.iot.v1.DeviceRegistry.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(deviceRegistry_); - deviceRegistry_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_UpdateDeviceRegistryRequest_descriptor; @@ -276,7 +206,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (updateMask_ != null) { output.writeMessage(2, getUpdateMask()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -291,7 +221,7 @@ public int getSerializedSize() { if (updateMask_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -315,7 +245,7 @@ public boolean equals(final java.lang.Object obj) { if (hasUpdateMask()) { if (!getUpdateMask().equals(other.getUpdateMask())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -334,7 +264,7 @@ public int hashCode() { hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; hash = (53 * hash) + getUpdateMask().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -463,17 +393,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.UpdateDeviceRegistryRequest.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 @@ -584,7 +507,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.UpdateDeviceRegistryRequest oth if (other.hasUpdateMask()) { mergeUpdateMask(other.getUpdateMask()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -599,18 +522,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.UpdateDeviceRegistryRequest 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(getDeviceRegistryFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + + 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.iot.v1.UpdateDeviceRegistryRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1096,7 +1044,18 @@ public UpdateDeviceRegistryRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateDeviceRegistryRequest(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/UpdateDeviceRequest.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/UpdateDeviceRequest.java index de616956ae39..2dc91ad7c76c 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/UpdateDeviceRequest.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/UpdateDeviceRequest.java @@ -50,75 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private UpdateDeviceRequest( - 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 18: - { - com.google.cloud.iot.v1.Device.Builder subBuilder = null; - if (device_ != null) { - subBuilder = device_.toBuilder(); - } - device_ = - input.readMessage(com.google.cloud.iot.v1.Device.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(device_); - device_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - 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.iot.v1.DeviceManagerProto .internal_static_google_cloud_iot_v1_UpdateDeviceRequest_descriptor; @@ -267,7 +198,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (updateMask_ != null) { output.writeMessage(3, getUpdateMask()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -282,7 +213,7 @@ public int getSerializedSize() { if (updateMask_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateMask()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -306,7 +237,7 @@ public boolean equals(final java.lang.Object obj) { if (hasUpdateMask()) { if (!getUpdateMask().equals(other.getUpdateMask())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -325,7 +256,7 @@ public int hashCode() { hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; hash = (53 * hash) + getUpdateMask().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -454,17 +385,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.UpdateDeviceRequest.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 @@ -574,7 +498,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.UpdateDeviceRequest other) { if (other.hasUpdateMask()) { mergeUpdateMask(other.getUpdateMask()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -589,17 +513,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.UpdateDeviceRequest 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 18: + { + input.readMessage(getDeviceFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + 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.iot.v1.UpdateDeviceRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1069,7 +1019,18 @@ public UpdateDeviceRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateDeviceRequest(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-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/X509CertificateDetails.java b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/X509CertificateDetails.java index 9492db6d0b75..8f67eac45b36 100644 --- a/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/X509CertificateDetails.java +++ b/java-iot/proto-google-cloud-iot-v1/src/main/java/com/google/cloud/iot/v1/X509CertificateDetails.java @@ -55,103 +55,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private X509CertificateDetails( - 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(); - - issuer_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - subject_ = s; - break; - } - case 26: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (startTime_ != null) { - subBuilder = startTime_.toBuilder(); - } - startTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(startTime_); - startTime_ = subBuilder.buildPartial(); - } - - break; - } - case 34: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (expiryTime_ != null) { - subBuilder = expiryTime_.toBuilder(); - } - expiryTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(expiryTime_); - expiryTime_ = subBuilder.buildPartial(); - } - - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - - signatureAlgorithm_ = s; - break; - } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); - - publicKeyType_ = 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.iot.v1.ResourcesProto .internal_static_google_cloud_iot_v1_X509CertificateDetails_descriptor; @@ -487,7 +390,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(publicKeyType_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, publicKeyType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -514,7 +417,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(publicKeyType_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, publicKeyType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -542,7 +445,7 @@ public boolean equals(final java.lang.Object obj) { } if (!getSignatureAlgorithm().equals(other.getSignatureAlgorithm())) return false; if (!getPublicKeyType().equals(other.getPublicKeyType())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -569,7 +472,7 @@ public int hashCode() { hash = (53 * hash) + getSignatureAlgorithm().hashCode(); hash = (37 * hash) + PUBLIC_KEY_TYPE_FIELD_NUMBER; hash = (53 * hash) + getPublicKeyType().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -698,17 +601,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.iot.v1.X509CertificateDetails.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 @@ -846,7 +742,7 @@ public Builder mergeFrom(com.google.cloud.iot.v1.X509CertificateDetails other) { publicKeyType_ = other.publicKeyType_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -861,17 +757,67 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.iot.v1.X509CertificateDetails 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: + { + issuer_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + subject_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 34: + { + input.readMessage(getExpiryTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 34 + case 42: + { + signatureAlgorithm_ = input.readStringRequireUtf8(); + + break; + } // case 42 + case 50: + { + publicKeyType_ = input.readStringRequireUtf8(); + + break; + } // case 50 + 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.iot.v1.X509CertificateDetails) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1693,7 +1639,18 @@ public X509CertificateDetails parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new X509CertificateDetails(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(); } };