1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/iot/v1/resources.proto 18 19 package com.google.cloud.iot.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * A server-stored registry credential used to validate device credentials. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.iot.v1.RegistryCredential} 29 */ 30 public final class RegistryCredential extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.RegistryCredential) 33 RegistryCredentialOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use RegistryCredential.newBuilder() to construct. RegistryCredential(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private RegistryCredential(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 RegistryCredential()40 private RegistryCredential() {} 41 42 @java.lang.Override 43 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)44 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 45 return new RegistryCredential(); 46 } 47 48 @java.lang.Override getUnknownFields()49 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 50 return this.unknownFields; 51 } 52 getDescriptor()53 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 54 return com.google.cloud.iot.v1.ResourcesProto 55 .internal_static_google_cloud_iot_v1_RegistryCredential_descriptor; 56 } 57 58 @java.lang.Override 59 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()60 internalGetFieldAccessorTable() { 61 return com.google.cloud.iot.v1.ResourcesProto 62 .internal_static_google_cloud_iot_v1_RegistryCredential_fieldAccessorTable 63 .ensureFieldAccessorsInitialized( 64 com.google.cloud.iot.v1.RegistryCredential.class, 65 com.google.cloud.iot.v1.RegistryCredential.Builder.class); 66 } 67 68 private int credentialCase_ = 0; 69 private java.lang.Object credential_; 70 71 public enum CredentialCase 72 implements 73 com.google.protobuf.Internal.EnumLite, 74 com.google.protobuf.AbstractMessage.InternalOneOfEnum { 75 PUBLIC_KEY_CERTIFICATE(1), 76 CREDENTIAL_NOT_SET(0); 77 private final int value; 78 CredentialCase(int value)79 private CredentialCase(int value) { 80 this.value = value; 81 } 82 /** 83 * @param value The number of the enum to look for. 84 * @return The enum associated with the given number. 85 * @deprecated Use {@link #forNumber(int)} instead. 86 */ 87 @java.lang.Deprecated valueOf(int value)88 public static CredentialCase valueOf(int value) { 89 return forNumber(value); 90 } 91 forNumber(int value)92 public static CredentialCase forNumber(int value) { 93 switch (value) { 94 case 1: 95 return PUBLIC_KEY_CERTIFICATE; 96 case 0: 97 return CREDENTIAL_NOT_SET; 98 default: 99 return null; 100 } 101 } 102 getNumber()103 public int getNumber() { 104 return this.value; 105 } 106 }; 107 getCredentialCase()108 public CredentialCase getCredentialCase() { 109 return CredentialCase.forNumber(credentialCase_); 110 } 111 112 public static final int PUBLIC_KEY_CERTIFICATE_FIELD_NUMBER = 1; 113 /** 114 * 115 * 116 * <pre> 117 * A public key certificate used to verify the device credentials. 118 * </pre> 119 * 120 * <code>.google.cloud.iot.v1.PublicKeyCertificate public_key_certificate = 1;</code> 121 * 122 * @return Whether the publicKeyCertificate field is set. 123 */ 124 @java.lang.Override hasPublicKeyCertificate()125 public boolean hasPublicKeyCertificate() { 126 return credentialCase_ == 1; 127 } 128 /** 129 * 130 * 131 * <pre> 132 * A public key certificate used to verify the device credentials. 133 * </pre> 134 * 135 * <code>.google.cloud.iot.v1.PublicKeyCertificate public_key_certificate = 1;</code> 136 * 137 * @return The publicKeyCertificate. 138 */ 139 @java.lang.Override getPublicKeyCertificate()140 public com.google.cloud.iot.v1.PublicKeyCertificate getPublicKeyCertificate() { 141 if (credentialCase_ == 1) { 142 return (com.google.cloud.iot.v1.PublicKeyCertificate) credential_; 143 } 144 return com.google.cloud.iot.v1.PublicKeyCertificate.getDefaultInstance(); 145 } 146 /** 147 * 148 * 149 * <pre> 150 * A public key certificate used to verify the device credentials. 151 * </pre> 152 * 153 * <code>.google.cloud.iot.v1.PublicKeyCertificate public_key_certificate = 1;</code> 154 */ 155 @java.lang.Override getPublicKeyCertificateOrBuilder()156 public com.google.cloud.iot.v1.PublicKeyCertificateOrBuilder getPublicKeyCertificateOrBuilder() { 157 if (credentialCase_ == 1) { 158 return (com.google.cloud.iot.v1.PublicKeyCertificate) credential_; 159 } 160 return com.google.cloud.iot.v1.PublicKeyCertificate.getDefaultInstance(); 161 } 162 163 private byte memoizedIsInitialized = -1; 164 165 @java.lang.Override isInitialized()166 public final boolean isInitialized() { 167 byte isInitialized = memoizedIsInitialized; 168 if (isInitialized == 1) return true; 169 if (isInitialized == 0) return false; 170 171 memoizedIsInitialized = 1; 172 return true; 173 } 174 175 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)176 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 177 if (credentialCase_ == 1) { 178 output.writeMessage(1, (com.google.cloud.iot.v1.PublicKeyCertificate) credential_); 179 } 180 getUnknownFields().writeTo(output); 181 } 182 183 @java.lang.Override getSerializedSize()184 public int getSerializedSize() { 185 int size = memoizedSize; 186 if (size != -1) return size; 187 188 size = 0; 189 if (credentialCase_ == 1) { 190 size += 191 com.google.protobuf.CodedOutputStream.computeMessageSize( 192 1, (com.google.cloud.iot.v1.PublicKeyCertificate) credential_); 193 } 194 size += getUnknownFields().getSerializedSize(); 195 memoizedSize = size; 196 return size; 197 } 198 199 @java.lang.Override equals(final java.lang.Object obj)200 public boolean equals(final java.lang.Object obj) { 201 if (obj == this) { 202 return true; 203 } 204 if (!(obj instanceof com.google.cloud.iot.v1.RegistryCredential)) { 205 return super.equals(obj); 206 } 207 com.google.cloud.iot.v1.RegistryCredential other = 208 (com.google.cloud.iot.v1.RegistryCredential) obj; 209 210 if (!getCredentialCase().equals(other.getCredentialCase())) return false; 211 switch (credentialCase_) { 212 case 1: 213 if (!getPublicKeyCertificate().equals(other.getPublicKeyCertificate())) return false; 214 break; 215 case 0: 216 default: 217 } 218 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 219 return true; 220 } 221 222 @java.lang.Override hashCode()223 public int hashCode() { 224 if (memoizedHashCode != 0) { 225 return memoizedHashCode; 226 } 227 int hash = 41; 228 hash = (19 * hash) + getDescriptor().hashCode(); 229 switch (credentialCase_) { 230 case 1: 231 hash = (37 * hash) + PUBLIC_KEY_CERTIFICATE_FIELD_NUMBER; 232 hash = (53 * hash) + getPublicKeyCertificate().hashCode(); 233 break; 234 case 0: 235 default: 236 } 237 hash = (29 * hash) + getUnknownFields().hashCode(); 238 memoizedHashCode = hash; 239 return hash; 240 } 241 parseFrom(java.nio.ByteBuffer data)242 public static com.google.cloud.iot.v1.RegistryCredential parseFrom(java.nio.ByteBuffer data) 243 throws com.google.protobuf.InvalidProtocolBufferException { 244 return PARSER.parseFrom(data); 245 } 246 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)247 public static com.google.cloud.iot.v1.RegistryCredential parseFrom( 248 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 249 throws com.google.protobuf.InvalidProtocolBufferException { 250 return PARSER.parseFrom(data, extensionRegistry); 251 } 252 parseFrom( com.google.protobuf.ByteString data)253 public static com.google.cloud.iot.v1.RegistryCredential parseFrom( 254 com.google.protobuf.ByteString data) 255 throws com.google.protobuf.InvalidProtocolBufferException { 256 return PARSER.parseFrom(data); 257 } 258 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)259 public static com.google.cloud.iot.v1.RegistryCredential parseFrom( 260 com.google.protobuf.ByteString data, 261 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 262 throws com.google.protobuf.InvalidProtocolBufferException { 263 return PARSER.parseFrom(data, extensionRegistry); 264 } 265 parseFrom(byte[] data)266 public static com.google.cloud.iot.v1.RegistryCredential parseFrom(byte[] data) 267 throws com.google.protobuf.InvalidProtocolBufferException { 268 return PARSER.parseFrom(data); 269 } 270 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)271 public static com.google.cloud.iot.v1.RegistryCredential parseFrom( 272 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 273 throws com.google.protobuf.InvalidProtocolBufferException { 274 return PARSER.parseFrom(data, extensionRegistry); 275 } 276 parseFrom(java.io.InputStream input)277 public static com.google.cloud.iot.v1.RegistryCredential parseFrom(java.io.InputStream input) 278 throws java.io.IOException { 279 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 280 } 281 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)282 public static com.google.cloud.iot.v1.RegistryCredential parseFrom( 283 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 284 throws java.io.IOException { 285 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 286 PARSER, input, extensionRegistry); 287 } 288 parseDelimitedFrom( java.io.InputStream input)289 public static com.google.cloud.iot.v1.RegistryCredential parseDelimitedFrom( 290 java.io.InputStream input) throws java.io.IOException { 291 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 292 } 293 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)294 public static com.google.cloud.iot.v1.RegistryCredential parseDelimitedFrom( 295 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 296 throws java.io.IOException { 297 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 298 PARSER, input, extensionRegistry); 299 } 300 parseFrom( com.google.protobuf.CodedInputStream input)301 public static com.google.cloud.iot.v1.RegistryCredential parseFrom( 302 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 303 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 304 } 305 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)306 public static com.google.cloud.iot.v1.RegistryCredential parseFrom( 307 com.google.protobuf.CodedInputStream input, 308 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 309 throws java.io.IOException { 310 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 311 PARSER, input, extensionRegistry); 312 } 313 314 @java.lang.Override newBuilderForType()315 public Builder newBuilderForType() { 316 return newBuilder(); 317 } 318 newBuilder()319 public static Builder newBuilder() { 320 return DEFAULT_INSTANCE.toBuilder(); 321 } 322 newBuilder(com.google.cloud.iot.v1.RegistryCredential prototype)323 public static Builder newBuilder(com.google.cloud.iot.v1.RegistryCredential prototype) { 324 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 325 } 326 327 @java.lang.Override toBuilder()328 public Builder toBuilder() { 329 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 330 } 331 332 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)333 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 334 Builder builder = new Builder(parent); 335 return builder; 336 } 337 /** 338 * 339 * 340 * <pre> 341 * A server-stored registry credential used to validate device credentials. 342 * </pre> 343 * 344 * Protobuf type {@code google.cloud.iot.v1.RegistryCredential} 345 */ 346 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 347 implements 348 // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.RegistryCredential) 349 com.google.cloud.iot.v1.RegistryCredentialOrBuilder { getDescriptor()350 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 351 return com.google.cloud.iot.v1.ResourcesProto 352 .internal_static_google_cloud_iot_v1_RegistryCredential_descriptor; 353 } 354 355 @java.lang.Override 356 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()357 internalGetFieldAccessorTable() { 358 return com.google.cloud.iot.v1.ResourcesProto 359 .internal_static_google_cloud_iot_v1_RegistryCredential_fieldAccessorTable 360 .ensureFieldAccessorsInitialized( 361 com.google.cloud.iot.v1.RegistryCredential.class, 362 com.google.cloud.iot.v1.RegistryCredential.Builder.class); 363 } 364 365 // Construct using com.google.cloud.iot.v1.RegistryCredential.newBuilder() Builder()366 private Builder() {} 367 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)368 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 369 super(parent); 370 } 371 372 @java.lang.Override clear()373 public Builder clear() { 374 super.clear(); 375 bitField0_ = 0; 376 if (publicKeyCertificateBuilder_ != null) { 377 publicKeyCertificateBuilder_.clear(); 378 } 379 credentialCase_ = 0; 380 credential_ = null; 381 return this; 382 } 383 384 @java.lang.Override getDescriptorForType()385 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 386 return com.google.cloud.iot.v1.ResourcesProto 387 .internal_static_google_cloud_iot_v1_RegistryCredential_descriptor; 388 } 389 390 @java.lang.Override getDefaultInstanceForType()391 public com.google.cloud.iot.v1.RegistryCredential getDefaultInstanceForType() { 392 return com.google.cloud.iot.v1.RegistryCredential.getDefaultInstance(); 393 } 394 395 @java.lang.Override build()396 public com.google.cloud.iot.v1.RegistryCredential build() { 397 com.google.cloud.iot.v1.RegistryCredential result = buildPartial(); 398 if (!result.isInitialized()) { 399 throw newUninitializedMessageException(result); 400 } 401 return result; 402 } 403 404 @java.lang.Override buildPartial()405 public com.google.cloud.iot.v1.RegistryCredential buildPartial() { 406 com.google.cloud.iot.v1.RegistryCredential result = 407 new com.google.cloud.iot.v1.RegistryCredential(this); 408 if (bitField0_ != 0) { 409 buildPartial0(result); 410 } 411 buildPartialOneofs(result); 412 onBuilt(); 413 return result; 414 } 415 buildPartial0(com.google.cloud.iot.v1.RegistryCredential result)416 private void buildPartial0(com.google.cloud.iot.v1.RegistryCredential result) { 417 int from_bitField0_ = bitField0_; 418 } 419 buildPartialOneofs(com.google.cloud.iot.v1.RegistryCredential result)420 private void buildPartialOneofs(com.google.cloud.iot.v1.RegistryCredential result) { 421 result.credentialCase_ = credentialCase_; 422 result.credential_ = this.credential_; 423 if (credentialCase_ == 1 && publicKeyCertificateBuilder_ != null) { 424 result.credential_ = publicKeyCertificateBuilder_.build(); 425 } 426 } 427 428 @java.lang.Override clone()429 public Builder clone() { 430 return super.clone(); 431 } 432 433 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)434 public Builder setField( 435 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 436 return super.setField(field, value); 437 } 438 439 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)440 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 441 return super.clearField(field); 442 } 443 444 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)445 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 446 return super.clearOneof(oneof); 447 } 448 449 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)450 public Builder setRepeatedField( 451 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 452 return super.setRepeatedField(field, index, value); 453 } 454 455 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)456 public Builder addRepeatedField( 457 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 458 return super.addRepeatedField(field, value); 459 } 460 461 @java.lang.Override mergeFrom(com.google.protobuf.Message other)462 public Builder mergeFrom(com.google.protobuf.Message other) { 463 if (other instanceof com.google.cloud.iot.v1.RegistryCredential) { 464 return mergeFrom((com.google.cloud.iot.v1.RegistryCredential) other); 465 } else { 466 super.mergeFrom(other); 467 return this; 468 } 469 } 470 mergeFrom(com.google.cloud.iot.v1.RegistryCredential other)471 public Builder mergeFrom(com.google.cloud.iot.v1.RegistryCredential other) { 472 if (other == com.google.cloud.iot.v1.RegistryCredential.getDefaultInstance()) return this; 473 switch (other.getCredentialCase()) { 474 case PUBLIC_KEY_CERTIFICATE: 475 { 476 mergePublicKeyCertificate(other.getPublicKeyCertificate()); 477 break; 478 } 479 case CREDENTIAL_NOT_SET: 480 { 481 break; 482 } 483 } 484 this.mergeUnknownFields(other.getUnknownFields()); 485 onChanged(); 486 return this; 487 } 488 489 @java.lang.Override isInitialized()490 public final boolean isInitialized() { 491 return true; 492 } 493 494 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)495 public Builder mergeFrom( 496 com.google.protobuf.CodedInputStream input, 497 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 498 throws java.io.IOException { 499 if (extensionRegistry == null) { 500 throw new java.lang.NullPointerException(); 501 } 502 try { 503 boolean done = false; 504 while (!done) { 505 int tag = input.readTag(); 506 switch (tag) { 507 case 0: 508 done = true; 509 break; 510 case 10: 511 { 512 input.readMessage( 513 getPublicKeyCertificateFieldBuilder().getBuilder(), extensionRegistry); 514 credentialCase_ = 1; 515 break; 516 } // case 10 517 default: 518 { 519 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 520 done = true; // was an endgroup tag 521 } 522 break; 523 } // default: 524 } // switch (tag) 525 } // while (!done) 526 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 527 throw e.unwrapIOException(); 528 } finally { 529 onChanged(); 530 } // finally 531 return this; 532 } 533 534 private int credentialCase_ = 0; 535 private java.lang.Object credential_; 536 getCredentialCase()537 public CredentialCase getCredentialCase() { 538 return CredentialCase.forNumber(credentialCase_); 539 } 540 clearCredential()541 public Builder clearCredential() { 542 credentialCase_ = 0; 543 credential_ = null; 544 onChanged(); 545 return this; 546 } 547 548 private int bitField0_; 549 550 private com.google.protobuf.SingleFieldBuilderV3< 551 com.google.cloud.iot.v1.PublicKeyCertificate, 552 com.google.cloud.iot.v1.PublicKeyCertificate.Builder, 553 com.google.cloud.iot.v1.PublicKeyCertificateOrBuilder> 554 publicKeyCertificateBuilder_; 555 /** 556 * 557 * 558 * <pre> 559 * A public key certificate used to verify the device credentials. 560 * </pre> 561 * 562 * <code>.google.cloud.iot.v1.PublicKeyCertificate public_key_certificate = 1;</code> 563 * 564 * @return Whether the publicKeyCertificate field is set. 565 */ 566 @java.lang.Override hasPublicKeyCertificate()567 public boolean hasPublicKeyCertificate() { 568 return credentialCase_ == 1; 569 } 570 /** 571 * 572 * 573 * <pre> 574 * A public key certificate used to verify the device credentials. 575 * </pre> 576 * 577 * <code>.google.cloud.iot.v1.PublicKeyCertificate public_key_certificate = 1;</code> 578 * 579 * @return The publicKeyCertificate. 580 */ 581 @java.lang.Override getPublicKeyCertificate()582 public com.google.cloud.iot.v1.PublicKeyCertificate getPublicKeyCertificate() { 583 if (publicKeyCertificateBuilder_ == null) { 584 if (credentialCase_ == 1) { 585 return (com.google.cloud.iot.v1.PublicKeyCertificate) credential_; 586 } 587 return com.google.cloud.iot.v1.PublicKeyCertificate.getDefaultInstance(); 588 } else { 589 if (credentialCase_ == 1) { 590 return publicKeyCertificateBuilder_.getMessage(); 591 } 592 return com.google.cloud.iot.v1.PublicKeyCertificate.getDefaultInstance(); 593 } 594 } 595 /** 596 * 597 * 598 * <pre> 599 * A public key certificate used to verify the device credentials. 600 * </pre> 601 * 602 * <code>.google.cloud.iot.v1.PublicKeyCertificate public_key_certificate = 1;</code> 603 */ setPublicKeyCertificate(com.google.cloud.iot.v1.PublicKeyCertificate value)604 public Builder setPublicKeyCertificate(com.google.cloud.iot.v1.PublicKeyCertificate value) { 605 if (publicKeyCertificateBuilder_ == null) { 606 if (value == null) { 607 throw new NullPointerException(); 608 } 609 credential_ = value; 610 onChanged(); 611 } else { 612 publicKeyCertificateBuilder_.setMessage(value); 613 } 614 credentialCase_ = 1; 615 return this; 616 } 617 /** 618 * 619 * 620 * <pre> 621 * A public key certificate used to verify the device credentials. 622 * </pre> 623 * 624 * <code>.google.cloud.iot.v1.PublicKeyCertificate public_key_certificate = 1;</code> 625 */ setPublicKeyCertificate( com.google.cloud.iot.v1.PublicKeyCertificate.Builder builderForValue)626 public Builder setPublicKeyCertificate( 627 com.google.cloud.iot.v1.PublicKeyCertificate.Builder builderForValue) { 628 if (publicKeyCertificateBuilder_ == null) { 629 credential_ = builderForValue.build(); 630 onChanged(); 631 } else { 632 publicKeyCertificateBuilder_.setMessage(builderForValue.build()); 633 } 634 credentialCase_ = 1; 635 return this; 636 } 637 /** 638 * 639 * 640 * <pre> 641 * A public key certificate used to verify the device credentials. 642 * </pre> 643 * 644 * <code>.google.cloud.iot.v1.PublicKeyCertificate public_key_certificate = 1;</code> 645 */ mergePublicKeyCertificate(com.google.cloud.iot.v1.PublicKeyCertificate value)646 public Builder mergePublicKeyCertificate(com.google.cloud.iot.v1.PublicKeyCertificate value) { 647 if (publicKeyCertificateBuilder_ == null) { 648 if (credentialCase_ == 1 649 && credential_ != com.google.cloud.iot.v1.PublicKeyCertificate.getDefaultInstance()) { 650 credential_ = 651 com.google.cloud.iot.v1.PublicKeyCertificate.newBuilder( 652 (com.google.cloud.iot.v1.PublicKeyCertificate) credential_) 653 .mergeFrom(value) 654 .buildPartial(); 655 } else { 656 credential_ = value; 657 } 658 onChanged(); 659 } else { 660 if (credentialCase_ == 1) { 661 publicKeyCertificateBuilder_.mergeFrom(value); 662 } else { 663 publicKeyCertificateBuilder_.setMessage(value); 664 } 665 } 666 credentialCase_ = 1; 667 return this; 668 } 669 /** 670 * 671 * 672 * <pre> 673 * A public key certificate used to verify the device credentials. 674 * </pre> 675 * 676 * <code>.google.cloud.iot.v1.PublicKeyCertificate public_key_certificate = 1;</code> 677 */ clearPublicKeyCertificate()678 public Builder clearPublicKeyCertificate() { 679 if (publicKeyCertificateBuilder_ == null) { 680 if (credentialCase_ == 1) { 681 credentialCase_ = 0; 682 credential_ = null; 683 onChanged(); 684 } 685 } else { 686 if (credentialCase_ == 1) { 687 credentialCase_ = 0; 688 credential_ = null; 689 } 690 publicKeyCertificateBuilder_.clear(); 691 } 692 return this; 693 } 694 /** 695 * 696 * 697 * <pre> 698 * A public key certificate used to verify the device credentials. 699 * </pre> 700 * 701 * <code>.google.cloud.iot.v1.PublicKeyCertificate public_key_certificate = 1;</code> 702 */ getPublicKeyCertificateBuilder()703 public com.google.cloud.iot.v1.PublicKeyCertificate.Builder getPublicKeyCertificateBuilder() { 704 return getPublicKeyCertificateFieldBuilder().getBuilder(); 705 } 706 /** 707 * 708 * 709 * <pre> 710 * A public key certificate used to verify the device credentials. 711 * </pre> 712 * 713 * <code>.google.cloud.iot.v1.PublicKeyCertificate public_key_certificate = 1;</code> 714 */ 715 @java.lang.Override 716 public com.google.cloud.iot.v1.PublicKeyCertificateOrBuilder getPublicKeyCertificateOrBuilder()717 getPublicKeyCertificateOrBuilder() { 718 if ((credentialCase_ == 1) && (publicKeyCertificateBuilder_ != null)) { 719 return publicKeyCertificateBuilder_.getMessageOrBuilder(); 720 } else { 721 if (credentialCase_ == 1) { 722 return (com.google.cloud.iot.v1.PublicKeyCertificate) credential_; 723 } 724 return com.google.cloud.iot.v1.PublicKeyCertificate.getDefaultInstance(); 725 } 726 } 727 /** 728 * 729 * 730 * <pre> 731 * A public key certificate used to verify the device credentials. 732 * </pre> 733 * 734 * <code>.google.cloud.iot.v1.PublicKeyCertificate public_key_certificate = 1;</code> 735 */ 736 private com.google.protobuf.SingleFieldBuilderV3< 737 com.google.cloud.iot.v1.PublicKeyCertificate, 738 com.google.cloud.iot.v1.PublicKeyCertificate.Builder, 739 com.google.cloud.iot.v1.PublicKeyCertificateOrBuilder> getPublicKeyCertificateFieldBuilder()740 getPublicKeyCertificateFieldBuilder() { 741 if (publicKeyCertificateBuilder_ == null) { 742 if (!(credentialCase_ == 1)) { 743 credential_ = com.google.cloud.iot.v1.PublicKeyCertificate.getDefaultInstance(); 744 } 745 publicKeyCertificateBuilder_ = 746 new com.google.protobuf.SingleFieldBuilderV3< 747 com.google.cloud.iot.v1.PublicKeyCertificate, 748 com.google.cloud.iot.v1.PublicKeyCertificate.Builder, 749 com.google.cloud.iot.v1.PublicKeyCertificateOrBuilder>( 750 (com.google.cloud.iot.v1.PublicKeyCertificate) credential_, 751 getParentForChildren(), 752 isClean()); 753 credential_ = null; 754 } 755 credentialCase_ = 1; 756 onChanged(); 757 return publicKeyCertificateBuilder_; 758 } 759 760 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)761 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 762 return super.setUnknownFields(unknownFields); 763 } 764 765 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)766 public final Builder mergeUnknownFields( 767 final com.google.protobuf.UnknownFieldSet unknownFields) { 768 return super.mergeUnknownFields(unknownFields); 769 } 770 771 // @@protoc_insertion_point(builder_scope:google.cloud.iot.v1.RegistryCredential) 772 } 773 774 // @@protoc_insertion_point(class_scope:google.cloud.iot.v1.RegistryCredential) 775 private static final com.google.cloud.iot.v1.RegistryCredential DEFAULT_INSTANCE; 776 777 static { 778 DEFAULT_INSTANCE = new com.google.cloud.iot.v1.RegistryCredential(); 779 } 780 getDefaultInstance()781 public static com.google.cloud.iot.v1.RegistryCredential getDefaultInstance() { 782 return DEFAULT_INSTANCE; 783 } 784 785 private static final com.google.protobuf.Parser<RegistryCredential> PARSER = 786 new com.google.protobuf.AbstractParser<RegistryCredential>() { 787 @java.lang.Override 788 public RegistryCredential parsePartialFrom( 789 com.google.protobuf.CodedInputStream input, 790 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 791 throws com.google.protobuf.InvalidProtocolBufferException { 792 Builder builder = newBuilder(); 793 try { 794 builder.mergeFrom(input, extensionRegistry); 795 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 796 throw e.setUnfinishedMessage(builder.buildPartial()); 797 } catch (com.google.protobuf.UninitializedMessageException e) { 798 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 799 } catch (java.io.IOException e) { 800 throw new com.google.protobuf.InvalidProtocolBufferException(e) 801 .setUnfinishedMessage(builder.buildPartial()); 802 } 803 return builder.buildPartial(); 804 } 805 }; 806 parser()807 public static com.google.protobuf.Parser<RegistryCredential> parser() { 808 return PARSER; 809 } 810 811 @java.lang.Override getParserForType()812 public com.google.protobuf.Parser<RegistryCredential> getParserForType() { 813 return PARSER; 814 } 815 816 @java.lang.Override getDefaultInstanceForType()817 public com.google.cloud.iot.v1.RegistryCredential getDefaultInstanceForType() { 818 return DEFAULT_INSTANCE; 819 } 820 } 821