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 * Gateway-related configuration and state. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.iot.v1.GatewayConfig} 29 */ 30 public final class GatewayConfig extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.GatewayConfig) 33 GatewayConfigOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use GatewayConfig.newBuilder() to construct. GatewayConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private GatewayConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 GatewayConfig()40 private GatewayConfig() { 41 gatewayType_ = 0; 42 gatewayAuthMethod_ = 0; 43 lastAccessedGatewayId_ = ""; 44 } 45 46 @java.lang.Override 47 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)48 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 49 return new GatewayConfig(); 50 } 51 52 @java.lang.Override getUnknownFields()53 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 54 return this.unknownFields; 55 } 56 getDescriptor()57 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 58 return com.google.cloud.iot.v1.ResourcesProto 59 .internal_static_google_cloud_iot_v1_GatewayConfig_descriptor; 60 } 61 62 @java.lang.Override 63 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()64 internalGetFieldAccessorTable() { 65 return com.google.cloud.iot.v1.ResourcesProto 66 .internal_static_google_cloud_iot_v1_GatewayConfig_fieldAccessorTable 67 .ensureFieldAccessorsInitialized( 68 com.google.cloud.iot.v1.GatewayConfig.class, 69 com.google.cloud.iot.v1.GatewayConfig.Builder.class); 70 } 71 72 public static final int GATEWAY_TYPE_FIELD_NUMBER = 1; 73 private int gatewayType_ = 0; 74 /** 75 * 76 * 77 * <pre> 78 * Indicates whether the device is a gateway. 79 * </pre> 80 * 81 * <code>.google.cloud.iot.v1.GatewayType gateway_type = 1;</code> 82 * 83 * @return The enum numeric value on the wire for gatewayType. 84 */ 85 @java.lang.Override getGatewayTypeValue()86 public int getGatewayTypeValue() { 87 return gatewayType_; 88 } 89 /** 90 * 91 * 92 * <pre> 93 * Indicates whether the device is a gateway. 94 * </pre> 95 * 96 * <code>.google.cloud.iot.v1.GatewayType gateway_type = 1;</code> 97 * 98 * @return The gatewayType. 99 */ 100 @java.lang.Override getGatewayType()101 public com.google.cloud.iot.v1.GatewayType getGatewayType() { 102 com.google.cloud.iot.v1.GatewayType result = 103 com.google.cloud.iot.v1.GatewayType.forNumber(gatewayType_); 104 return result == null ? com.google.cloud.iot.v1.GatewayType.UNRECOGNIZED : result; 105 } 106 107 public static final int GATEWAY_AUTH_METHOD_FIELD_NUMBER = 2; 108 private int gatewayAuthMethod_ = 0; 109 /** 110 * 111 * 112 * <pre> 113 * Indicates how to authorize and/or authenticate devices to access the 114 * gateway. 115 * </pre> 116 * 117 * <code>.google.cloud.iot.v1.GatewayAuthMethod gateway_auth_method = 2;</code> 118 * 119 * @return The enum numeric value on the wire for gatewayAuthMethod. 120 */ 121 @java.lang.Override getGatewayAuthMethodValue()122 public int getGatewayAuthMethodValue() { 123 return gatewayAuthMethod_; 124 } 125 /** 126 * 127 * 128 * <pre> 129 * Indicates how to authorize and/or authenticate devices to access the 130 * gateway. 131 * </pre> 132 * 133 * <code>.google.cloud.iot.v1.GatewayAuthMethod gateway_auth_method = 2;</code> 134 * 135 * @return The gatewayAuthMethod. 136 */ 137 @java.lang.Override getGatewayAuthMethod()138 public com.google.cloud.iot.v1.GatewayAuthMethod getGatewayAuthMethod() { 139 com.google.cloud.iot.v1.GatewayAuthMethod result = 140 com.google.cloud.iot.v1.GatewayAuthMethod.forNumber(gatewayAuthMethod_); 141 return result == null ? com.google.cloud.iot.v1.GatewayAuthMethod.UNRECOGNIZED : result; 142 } 143 144 public static final int LAST_ACCESSED_GATEWAY_ID_FIELD_NUMBER = 3; 145 146 @SuppressWarnings("serial") 147 private volatile java.lang.Object lastAccessedGatewayId_ = ""; 148 /** 149 * 150 * 151 * <pre> 152 * [Output only] The ID of the gateway the device accessed most recently. 153 * </pre> 154 * 155 * <code>string last_accessed_gateway_id = 3;</code> 156 * 157 * @return The lastAccessedGatewayId. 158 */ 159 @java.lang.Override getLastAccessedGatewayId()160 public java.lang.String getLastAccessedGatewayId() { 161 java.lang.Object ref = lastAccessedGatewayId_; 162 if (ref instanceof java.lang.String) { 163 return (java.lang.String) ref; 164 } else { 165 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 166 java.lang.String s = bs.toStringUtf8(); 167 lastAccessedGatewayId_ = s; 168 return s; 169 } 170 } 171 /** 172 * 173 * 174 * <pre> 175 * [Output only] The ID of the gateway the device accessed most recently. 176 * </pre> 177 * 178 * <code>string last_accessed_gateway_id = 3;</code> 179 * 180 * @return The bytes for lastAccessedGatewayId. 181 */ 182 @java.lang.Override getLastAccessedGatewayIdBytes()183 public com.google.protobuf.ByteString getLastAccessedGatewayIdBytes() { 184 java.lang.Object ref = lastAccessedGatewayId_; 185 if (ref instanceof java.lang.String) { 186 com.google.protobuf.ByteString b = 187 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 188 lastAccessedGatewayId_ = b; 189 return b; 190 } else { 191 return (com.google.protobuf.ByteString) ref; 192 } 193 } 194 195 public static final int LAST_ACCESSED_GATEWAY_TIME_FIELD_NUMBER = 4; 196 private com.google.protobuf.Timestamp lastAccessedGatewayTime_; 197 /** 198 * 199 * 200 * <pre> 201 * [Output only] The most recent time at which the device accessed the gateway 202 * specified in `last_accessed_gateway`. 203 * </pre> 204 * 205 * <code>.google.protobuf.Timestamp last_accessed_gateway_time = 4;</code> 206 * 207 * @return Whether the lastAccessedGatewayTime field is set. 208 */ 209 @java.lang.Override hasLastAccessedGatewayTime()210 public boolean hasLastAccessedGatewayTime() { 211 return lastAccessedGatewayTime_ != null; 212 } 213 /** 214 * 215 * 216 * <pre> 217 * [Output only] The most recent time at which the device accessed the gateway 218 * specified in `last_accessed_gateway`. 219 * </pre> 220 * 221 * <code>.google.protobuf.Timestamp last_accessed_gateway_time = 4;</code> 222 * 223 * @return The lastAccessedGatewayTime. 224 */ 225 @java.lang.Override getLastAccessedGatewayTime()226 public com.google.protobuf.Timestamp getLastAccessedGatewayTime() { 227 return lastAccessedGatewayTime_ == null 228 ? com.google.protobuf.Timestamp.getDefaultInstance() 229 : lastAccessedGatewayTime_; 230 } 231 /** 232 * 233 * 234 * <pre> 235 * [Output only] The most recent time at which the device accessed the gateway 236 * specified in `last_accessed_gateway`. 237 * </pre> 238 * 239 * <code>.google.protobuf.Timestamp last_accessed_gateway_time = 4;</code> 240 */ 241 @java.lang.Override getLastAccessedGatewayTimeOrBuilder()242 public com.google.protobuf.TimestampOrBuilder getLastAccessedGatewayTimeOrBuilder() { 243 return lastAccessedGatewayTime_ == null 244 ? com.google.protobuf.Timestamp.getDefaultInstance() 245 : lastAccessedGatewayTime_; 246 } 247 248 private byte memoizedIsInitialized = -1; 249 250 @java.lang.Override isInitialized()251 public final boolean isInitialized() { 252 byte isInitialized = memoizedIsInitialized; 253 if (isInitialized == 1) return true; 254 if (isInitialized == 0) return false; 255 256 memoizedIsInitialized = 1; 257 return true; 258 } 259 260 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)261 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 262 if (gatewayType_ != com.google.cloud.iot.v1.GatewayType.GATEWAY_TYPE_UNSPECIFIED.getNumber()) { 263 output.writeEnum(1, gatewayType_); 264 } 265 if (gatewayAuthMethod_ 266 != com.google.cloud.iot.v1.GatewayAuthMethod.GATEWAY_AUTH_METHOD_UNSPECIFIED.getNumber()) { 267 output.writeEnum(2, gatewayAuthMethod_); 268 } 269 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastAccessedGatewayId_)) { 270 com.google.protobuf.GeneratedMessageV3.writeString(output, 3, lastAccessedGatewayId_); 271 } 272 if (lastAccessedGatewayTime_ != null) { 273 output.writeMessage(4, getLastAccessedGatewayTime()); 274 } 275 getUnknownFields().writeTo(output); 276 } 277 278 @java.lang.Override getSerializedSize()279 public int getSerializedSize() { 280 int size = memoizedSize; 281 if (size != -1) return size; 282 283 size = 0; 284 if (gatewayType_ != com.google.cloud.iot.v1.GatewayType.GATEWAY_TYPE_UNSPECIFIED.getNumber()) { 285 size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, gatewayType_); 286 } 287 if (gatewayAuthMethod_ 288 != com.google.cloud.iot.v1.GatewayAuthMethod.GATEWAY_AUTH_METHOD_UNSPECIFIED.getNumber()) { 289 size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, gatewayAuthMethod_); 290 } 291 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastAccessedGatewayId_)) { 292 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, lastAccessedGatewayId_); 293 } 294 if (lastAccessedGatewayTime_ != null) { 295 size += 296 com.google.protobuf.CodedOutputStream.computeMessageSize(4, getLastAccessedGatewayTime()); 297 } 298 size += getUnknownFields().getSerializedSize(); 299 memoizedSize = size; 300 return size; 301 } 302 303 @java.lang.Override equals(final java.lang.Object obj)304 public boolean equals(final java.lang.Object obj) { 305 if (obj == this) { 306 return true; 307 } 308 if (!(obj instanceof com.google.cloud.iot.v1.GatewayConfig)) { 309 return super.equals(obj); 310 } 311 com.google.cloud.iot.v1.GatewayConfig other = (com.google.cloud.iot.v1.GatewayConfig) obj; 312 313 if (gatewayType_ != other.gatewayType_) return false; 314 if (gatewayAuthMethod_ != other.gatewayAuthMethod_) return false; 315 if (!getLastAccessedGatewayId().equals(other.getLastAccessedGatewayId())) return false; 316 if (hasLastAccessedGatewayTime() != other.hasLastAccessedGatewayTime()) return false; 317 if (hasLastAccessedGatewayTime()) { 318 if (!getLastAccessedGatewayTime().equals(other.getLastAccessedGatewayTime())) return false; 319 } 320 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 321 return true; 322 } 323 324 @java.lang.Override hashCode()325 public int hashCode() { 326 if (memoizedHashCode != 0) { 327 return memoizedHashCode; 328 } 329 int hash = 41; 330 hash = (19 * hash) + getDescriptor().hashCode(); 331 hash = (37 * hash) + GATEWAY_TYPE_FIELD_NUMBER; 332 hash = (53 * hash) + gatewayType_; 333 hash = (37 * hash) + GATEWAY_AUTH_METHOD_FIELD_NUMBER; 334 hash = (53 * hash) + gatewayAuthMethod_; 335 hash = (37 * hash) + LAST_ACCESSED_GATEWAY_ID_FIELD_NUMBER; 336 hash = (53 * hash) + getLastAccessedGatewayId().hashCode(); 337 if (hasLastAccessedGatewayTime()) { 338 hash = (37 * hash) + LAST_ACCESSED_GATEWAY_TIME_FIELD_NUMBER; 339 hash = (53 * hash) + getLastAccessedGatewayTime().hashCode(); 340 } 341 hash = (29 * hash) + getUnknownFields().hashCode(); 342 memoizedHashCode = hash; 343 return hash; 344 } 345 parseFrom(java.nio.ByteBuffer data)346 public static com.google.cloud.iot.v1.GatewayConfig parseFrom(java.nio.ByteBuffer data) 347 throws com.google.protobuf.InvalidProtocolBufferException { 348 return PARSER.parseFrom(data); 349 } 350 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)351 public static com.google.cloud.iot.v1.GatewayConfig parseFrom( 352 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 353 throws com.google.protobuf.InvalidProtocolBufferException { 354 return PARSER.parseFrom(data, extensionRegistry); 355 } 356 parseFrom(com.google.protobuf.ByteString data)357 public static com.google.cloud.iot.v1.GatewayConfig parseFrom(com.google.protobuf.ByteString data) 358 throws com.google.protobuf.InvalidProtocolBufferException { 359 return PARSER.parseFrom(data); 360 } 361 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)362 public static com.google.cloud.iot.v1.GatewayConfig parseFrom( 363 com.google.protobuf.ByteString data, 364 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 365 throws com.google.protobuf.InvalidProtocolBufferException { 366 return PARSER.parseFrom(data, extensionRegistry); 367 } 368 parseFrom(byte[] data)369 public static com.google.cloud.iot.v1.GatewayConfig parseFrom(byte[] data) 370 throws com.google.protobuf.InvalidProtocolBufferException { 371 return PARSER.parseFrom(data); 372 } 373 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)374 public static com.google.cloud.iot.v1.GatewayConfig parseFrom( 375 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 376 throws com.google.protobuf.InvalidProtocolBufferException { 377 return PARSER.parseFrom(data, extensionRegistry); 378 } 379 parseFrom(java.io.InputStream input)380 public static com.google.cloud.iot.v1.GatewayConfig parseFrom(java.io.InputStream input) 381 throws java.io.IOException { 382 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 383 } 384 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)385 public static com.google.cloud.iot.v1.GatewayConfig parseFrom( 386 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 387 throws java.io.IOException { 388 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 389 PARSER, input, extensionRegistry); 390 } 391 parseDelimitedFrom(java.io.InputStream input)392 public static com.google.cloud.iot.v1.GatewayConfig parseDelimitedFrom(java.io.InputStream input) 393 throws java.io.IOException { 394 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 395 } 396 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)397 public static com.google.cloud.iot.v1.GatewayConfig parseDelimitedFrom( 398 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 399 throws java.io.IOException { 400 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 401 PARSER, input, extensionRegistry); 402 } 403 parseFrom( com.google.protobuf.CodedInputStream input)404 public static com.google.cloud.iot.v1.GatewayConfig parseFrom( 405 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 406 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 407 } 408 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)409 public static com.google.cloud.iot.v1.GatewayConfig parseFrom( 410 com.google.protobuf.CodedInputStream input, 411 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 412 throws java.io.IOException { 413 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 414 PARSER, input, extensionRegistry); 415 } 416 417 @java.lang.Override newBuilderForType()418 public Builder newBuilderForType() { 419 return newBuilder(); 420 } 421 newBuilder()422 public static Builder newBuilder() { 423 return DEFAULT_INSTANCE.toBuilder(); 424 } 425 newBuilder(com.google.cloud.iot.v1.GatewayConfig prototype)426 public static Builder newBuilder(com.google.cloud.iot.v1.GatewayConfig prototype) { 427 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 428 } 429 430 @java.lang.Override toBuilder()431 public Builder toBuilder() { 432 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 433 } 434 435 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)436 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 437 Builder builder = new Builder(parent); 438 return builder; 439 } 440 /** 441 * 442 * 443 * <pre> 444 * Gateway-related configuration and state. 445 * </pre> 446 * 447 * Protobuf type {@code google.cloud.iot.v1.GatewayConfig} 448 */ 449 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 450 implements 451 // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.GatewayConfig) 452 com.google.cloud.iot.v1.GatewayConfigOrBuilder { getDescriptor()453 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 454 return com.google.cloud.iot.v1.ResourcesProto 455 .internal_static_google_cloud_iot_v1_GatewayConfig_descriptor; 456 } 457 458 @java.lang.Override 459 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()460 internalGetFieldAccessorTable() { 461 return com.google.cloud.iot.v1.ResourcesProto 462 .internal_static_google_cloud_iot_v1_GatewayConfig_fieldAccessorTable 463 .ensureFieldAccessorsInitialized( 464 com.google.cloud.iot.v1.GatewayConfig.class, 465 com.google.cloud.iot.v1.GatewayConfig.Builder.class); 466 } 467 468 // Construct using com.google.cloud.iot.v1.GatewayConfig.newBuilder() Builder()469 private Builder() {} 470 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)471 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 472 super(parent); 473 } 474 475 @java.lang.Override clear()476 public Builder clear() { 477 super.clear(); 478 bitField0_ = 0; 479 gatewayType_ = 0; 480 gatewayAuthMethod_ = 0; 481 lastAccessedGatewayId_ = ""; 482 lastAccessedGatewayTime_ = null; 483 if (lastAccessedGatewayTimeBuilder_ != null) { 484 lastAccessedGatewayTimeBuilder_.dispose(); 485 lastAccessedGatewayTimeBuilder_ = null; 486 } 487 return this; 488 } 489 490 @java.lang.Override getDescriptorForType()491 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 492 return com.google.cloud.iot.v1.ResourcesProto 493 .internal_static_google_cloud_iot_v1_GatewayConfig_descriptor; 494 } 495 496 @java.lang.Override getDefaultInstanceForType()497 public com.google.cloud.iot.v1.GatewayConfig getDefaultInstanceForType() { 498 return com.google.cloud.iot.v1.GatewayConfig.getDefaultInstance(); 499 } 500 501 @java.lang.Override build()502 public com.google.cloud.iot.v1.GatewayConfig build() { 503 com.google.cloud.iot.v1.GatewayConfig result = buildPartial(); 504 if (!result.isInitialized()) { 505 throw newUninitializedMessageException(result); 506 } 507 return result; 508 } 509 510 @java.lang.Override buildPartial()511 public com.google.cloud.iot.v1.GatewayConfig buildPartial() { 512 com.google.cloud.iot.v1.GatewayConfig result = 513 new com.google.cloud.iot.v1.GatewayConfig(this); 514 if (bitField0_ != 0) { 515 buildPartial0(result); 516 } 517 onBuilt(); 518 return result; 519 } 520 buildPartial0(com.google.cloud.iot.v1.GatewayConfig result)521 private void buildPartial0(com.google.cloud.iot.v1.GatewayConfig result) { 522 int from_bitField0_ = bitField0_; 523 if (((from_bitField0_ & 0x00000001) != 0)) { 524 result.gatewayType_ = gatewayType_; 525 } 526 if (((from_bitField0_ & 0x00000002) != 0)) { 527 result.gatewayAuthMethod_ = gatewayAuthMethod_; 528 } 529 if (((from_bitField0_ & 0x00000004) != 0)) { 530 result.lastAccessedGatewayId_ = lastAccessedGatewayId_; 531 } 532 if (((from_bitField0_ & 0x00000008) != 0)) { 533 result.lastAccessedGatewayTime_ = 534 lastAccessedGatewayTimeBuilder_ == null 535 ? lastAccessedGatewayTime_ 536 : lastAccessedGatewayTimeBuilder_.build(); 537 } 538 } 539 540 @java.lang.Override clone()541 public Builder clone() { 542 return super.clone(); 543 } 544 545 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)546 public Builder setField( 547 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 548 return super.setField(field, value); 549 } 550 551 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)552 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 553 return super.clearField(field); 554 } 555 556 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)557 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 558 return super.clearOneof(oneof); 559 } 560 561 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)562 public Builder setRepeatedField( 563 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 564 return super.setRepeatedField(field, index, value); 565 } 566 567 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)568 public Builder addRepeatedField( 569 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 570 return super.addRepeatedField(field, value); 571 } 572 573 @java.lang.Override mergeFrom(com.google.protobuf.Message other)574 public Builder mergeFrom(com.google.protobuf.Message other) { 575 if (other instanceof com.google.cloud.iot.v1.GatewayConfig) { 576 return mergeFrom((com.google.cloud.iot.v1.GatewayConfig) other); 577 } else { 578 super.mergeFrom(other); 579 return this; 580 } 581 } 582 mergeFrom(com.google.cloud.iot.v1.GatewayConfig other)583 public Builder mergeFrom(com.google.cloud.iot.v1.GatewayConfig other) { 584 if (other == com.google.cloud.iot.v1.GatewayConfig.getDefaultInstance()) return this; 585 if (other.gatewayType_ != 0) { 586 setGatewayTypeValue(other.getGatewayTypeValue()); 587 } 588 if (other.gatewayAuthMethod_ != 0) { 589 setGatewayAuthMethodValue(other.getGatewayAuthMethodValue()); 590 } 591 if (!other.getLastAccessedGatewayId().isEmpty()) { 592 lastAccessedGatewayId_ = other.lastAccessedGatewayId_; 593 bitField0_ |= 0x00000004; 594 onChanged(); 595 } 596 if (other.hasLastAccessedGatewayTime()) { 597 mergeLastAccessedGatewayTime(other.getLastAccessedGatewayTime()); 598 } 599 this.mergeUnknownFields(other.getUnknownFields()); 600 onChanged(); 601 return this; 602 } 603 604 @java.lang.Override isInitialized()605 public final boolean isInitialized() { 606 return true; 607 } 608 609 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)610 public Builder mergeFrom( 611 com.google.protobuf.CodedInputStream input, 612 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 613 throws java.io.IOException { 614 if (extensionRegistry == null) { 615 throw new java.lang.NullPointerException(); 616 } 617 try { 618 boolean done = false; 619 while (!done) { 620 int tag = input.readTag(); 621 switch (tag) { 622 case 0: 623 done = true; 624 break; 625 case 8: 626 { 627 gatewayType_ = input.readEnum(); 628 bitField0_ |= 0x00000001; 629 break; 630 } // case 8 631 case 16: 632 { 633 gatewayAuthMethod_ = input.readEnum(); 634 bitField0_ |= 0x00000002; 635 break; 636 } // case 16 637 case 26: 638 { 639 lastAccessedGatewayId_ = input.readStringRequireUtf8(); 640 bitField0_ |= 0x00000004; 641 break; 642 } // case 26 643 case 34: 644 { 645 input.readMessage( 646 getLastAccessedGatewayTimeFieldBuilder().getBuilder(), extensionRegistry); 647 bitField0_ |= 0x00000008; 648 break; 649 } // case 34 650 default: 651 { 652 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 653 done = true; // was an endgroup tag 654 } 655 break; 656 } // default: 657 } // switch (tag) 658 } // while (!done) 659 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 660 throw e.unwrapIOException(); 661 } finally { 662 onChanged(); 663 } // finally 664 return this; 665 } 666 667 private int bitField0_; 668 669 private int gatewayType_ = 0; 670 /** 671 * 672 * 673 * <pre> 674 * Indicates whether the device is a gateway. 675 * </pre> 676 * 677 * <code>.google.cloud.iot.v1.GatewayType gateway_type = 1;</code> 678 * 679 * @return The enum numeric value on the wire for gatewayType. 680 */ 681 @java.lang.Override getGatewayTypeValue()682 public int getGatewayTypeValue() { 683 return gatewayType_; 684 } 685 /** 686 * 687 * 688 * <pre> 689 * Indicates whether the device is a gateway. 690 * </pre> 691 * 692 * <code>.google.cloud.iot.v1.GatewayType gateway_type = 1;</code> 693 * 694 * @param value The enum numeric value on the wire for gatewayType to set. 695 * @return This builder for chaining. 696 */ setGatewayTypeValue(int value)697 public Builder setGatewayTypeValue(int value) { 698 gatewayType_ = value; 699 bitField0_ |= 0x00000001; 700 onChanged(); 701 return this; 702 } 703 /** 704 * 705 * 706 * <pre> 707 * Indicates whether the device is a gateway. 708 * </pre> 709 * 710 * <code>.google.cloud.iot.v1.GatewayType gateway_type = 1;</code> 711 * 712 * @return The gatewayType. 713 */ 714 @java.lang.Override getGatewayType()715 public com.google.cloud.iot.v1.GatewayType getGatewayType() { 716 com.google.cloud.iot.v1.GatewayType result = 717 com.google.cloud.iot.v1.GatewayType.forNumber(gatewayType_); 718 return result == null ? com.google.cloud.iot.v1.GatewayType.UNRECOGNIZED : result; 719 } 720 /** 721 * 722 * 723 * <pre> 724 * Indicates whether the device is a gateway. 725 * </pre> 726 * 727 * <code>.google.cloud.iot.v1.GatewayType gateway_type = 1;</code> 728 * 729 * @param value The gatewayType to set. 730 * @return This builder for chaining. 731 */ setGatewayType(com.google.cloud.iot.v1.GatewayType value)732 public Builder setGatewayType(com.google.cloud.iot.v1.GatewayType value) { 733 if (value == null) { 734 throw new NullPointerException(); 735 } 736 bitField0_ |= 0x00000001; 737 gatewayType_ = value.getNumber(); 738 onChanged(); 739 return this; 740 } 741 /** 742 * 743 * 744 * <pre> 745 * Indicates whether the device is a gateway. 746 * </pre> 747 * 748 * <code>.google.cloud.iot.v1.GatewayType gateway_type = 1;</code> 749 * 750 * @return This builder for chaining. 751 */ clearGatewayType()752 public Builder clearGatewayType() { 753 bitField0_ = (bitField0_ & ~0x00000001); 754 gatewayType_ = 0; 755 onChanged(); 756 return this; 757 } 758 759 private int gatewayAuthMethod_ = 0; 760 /** 761 * 762 * 763 * <pre> 764 * Indicates how to authorize and/or authenticate devices to access the 765 * gateway. 766 * </pre> 767 * 768 * <code>.google.cloud.iot.v1.GatewayAuthMethod gateway_auth_method = 2;</code> 769 * 770 * @return The enum numeric value on the wire for gatewayAuthMethod. 771 */ 772 @java.lang.Override getGatewayAuthMethodValue()773 public int getGatewayAuthMethodValue() { 774 return gatewayAuthMethod_; 775 } 776 /** 777 * 778 * 779 * <pre> 780 * Indicates how to authorize and/or authenticate devices to access the 781 * gateway. 782 * </pre> 783 * 784 * <code>.google.cloud.iot.v1.GatewayAuthMethod gateway_auth_method = 2;</code> 785 * 786 * @param value The enum numeric value on the wire for gatewayAuthMethod to set. 787 * @return This builder for chaining. 788 */ setGatewayAuthMethodValue(int value)789 public Builder setGatewayAuthMethodValue(int value) { 790 gatewayAuthMethod_ = value; 791 bitField0_ |= 0x00000002; 792 onChanged(); 793 return this; 794 } 795 /** 796 * 797 * 798 * <pre> 799 * Indicates how to authorize and/or authenticate devices to access the 800 * gateway. 801 * </pre> 802 * 803 * <code>.google.cloud.iot.v1.GatewayAuthMethod gateway_auth_method = 2;</code> 804 * 805 * @return The gatewayAuthMethod. 806 */ 807 @java.lang.Override getGatewayAuthMethod()808 public com.google.cloud.iot.v1.GatewayAuthMethod getGatewayAuthMethod() { 809 com.google.cloud.iot.v1.GatewayAuthMethod result = 810 com.google.cloud.iot.v1.GatewayAuthMethod.forNumber(gatewayAuthMethod_); 811 return result == null ? com.google.cloud.iot.v1.GatewayAuthMethod.UNRECOGNIZED : result; 812 } 813 /** 814 * 815 * 816 * <pre> 817 * Indicates how to authorize and/or authenticate devices to access the 818 * gateway. 819 * </pre> 820 * 821 * <code>.google.cloud.iot.v1.GatewayAuthMethod gateway_auth_method = 2;</code> 822 * 823 * @param value The gatewayAuthMethod to set. 824 * @return This builder for chaining. 825 */ setGatewayAuthMethod(com.google.cloud.iot.v1.GatewayAuthMethod value)826 public Builder setGatewayAuthMethod(com.google.cloud.iot.v1.GatewayAuthMethod value) { 827 if (value == null) { 828 throw new NullPointerException(); 829 } 830 bitField0_ |= 0x00000002; 831 gatewayAuthMethod_ = value.getNumber(); 832 onChanged(); 833 return this; 834 } 835 /** 836 * 837 * 838 * <pre> 839 * Indicates how to authorize and/or authenticate devices to access the 840 * gateway. 841 * </pre> 842 * 843 * <code>.google.cloud.iot.v1.GatewayAuthMethod gateway_auth_method = 2;</code> 844 * 845 * @return This builder for chaining. 846 */ clearGatewayAuthMethod()847 public Builder clearGatewayAuthMethod() { 848 bitField0_ = (bitField0_ & ~0x00000002); 849 gatewayAuthMethod_ = 0; 850 onChanged(); 851 return this; 852 } 853 854 private java.lang.Object lastAccessedGatewayId_ = ""; 855 /** 856 * 857 * 858 * <pre> 859 * [Output only] The ID of the gateway the device accessed most recently. 860 * </pre> 861 * 862 * <code>string last_accessed_gateway_id = 3;</code> 863 * 864 * @return The lastAccessedGatewayId. 865 */ getLastAccessedGatewayId()866 public java.lang.String getLastAccessedGatewayId() { 867 java.lang.Object ref = lastAccessedGatewayId_; 868 if (!(ref instanceof java.lang.String)) { 869 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 870 java.lang.String s = bs.toStringUtf8(); 871 lastAccessedGatewayId_ = s; 872 return s; 873 } else { 874 return (java.lang.String) ref; 875 } 876 } 877 /** 878 * 879 * 880 * <pre> 881 * [Output only] The ID of the gateway the device accessed most recently. 882 * </pre> 883 * 884 * <code>string last_accessed_gateway_id = 3;</code> 885 * 886 * @return The bytes for lastAccessedGatewayId. 887 */ getLastAccessedGatewayIdBytes()888 public com.google.protobuf.ByteString getLastAccessedGatewayIdBytes() { 889 java.lang.Object ref = lastAccessedGatewayId_; 890 if (ref instanceof String) { 891 com.google.protobuf.ByteString b = 892 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 893 lastAccessedGatewayId_ = b; 894 return b; 895 } else { 896 return (com.google.protobuf.ByteString) ref; 897 } 898 } 899 /** 900 * 901 * 902 * <pre> 903 * [Output only] The ID of the gateway the device accessed most recently. 904 * </pre> 905 * 906 * <code>string last_accessed_gateway_id = 3;</code> 907 * 908 * @param value The lastAccessedGatewayId to set. 909 * @return This builder for chaining. 910 */ setLastAccessedGatewayId(java.lang.String value)911 public Builder setLastAccessedGatewayId(java.lang.String value) { 912 if (value == null) { 913 throw new NullPointerException(); 914 } 915 lastAccessedGatewayId_ = value; 916 bitField0_ |= 0x00000004; 917 onChanged(); 918 return this; 919 } 920 /** 921 * 922 * 923 * <pre> 924 * [Output only] The ID of the gateway the device accessed most recently. 925 * </pre> 926 * 927 * <code>string last_accessed_gateway_id = 3;</code> 928 * 929 * @return This builder for chaining. 930 */ clearLastAccessedGatewayId()931 public Builder clearLastAccessedGatewayId() { 932 lastAccessedGatewayId_ = getDefaultInstance().getLastAccessedGatewayId(); 933 bitField0_ = (bitField0_ & ~0x00000004); 934 onChanged(); 935 return this; 936 } 937 /** 938 * 939 * 940 * <pre> 941 * [Output only] The ID of the gateway the device accessed most recently. 942 * </pre> 943 * 944 * <code>string last_accessed_gateway_id = 3;</code> 945 * 946 * @param value The bytes for lastAccessedGatewayId to set. 947 * @return This builder for chaining. 948 */ setLastAccessedGatewayIdBytes(com.google.protobuf.ByteString value)949 public Builder setLastAccessedGatewayIdBytes(com.google.protobuf.ByteString value) { 950 if (value == null) { 951 throw new NullPointerException(); 952 } 953 checkByteStringIsUtf8(value); 954 lastAccessedGatewayId_ = value; 955 bitField0_ |= 0x00000004; 956 onChanged(); 957 return this; 958 } 959 960 private com.google.protobuf.Timestamp lastAccessedGatewayTime_; 961 private com.google.protobuf.SingleFieldBuilderV3< 962 com.google.protobuf.Timestamp, 963 com.google.protobuf.Timestamp.Builder, 964 com.google.protobuf.TimestampOrBuilder> 965 lastAccessedGatewayTimeBuilder_; 966 /** 967 * 968 * 969 * <pre> 970 * [Output only] The most recent time at which the device accessed the gateway 971 * specified in `last_accessed_gateway`. 972 * </pre> 973 * 974 * <code>.google.protobuf.Timestamp last_accessed_gateway_time = 4;</code> 975 * 976 * @return Whether the lastAccessedGatewayTime field is set. 977 */ hasLastAccessedGatewayTime()978 public boolean hasLastAccessedGatewayTime() { 979 return ((bitField0_ & 0x00000008) != 0); 980 } 981 /** 982 * 983 * 984 * <pre> 985 * [Output only] The most recent time at which the device accessed the gateway 986 * specified in `last_accessed_gateway`. 987 * </pre> 988 * 989 * <code>.google.protobuf.Timestamp last_accessed_gateway_time = 4;</code> 990 * 991 * @return The lastAccessedGatewayTime. 992 */ getLastAccessedGatewayTime()993 public com.google.protobuf.Timestamp getLastAccessedGatewayTime() { 994 if (lastAccessedGatewayTimeBuilder_ == null) { 995 return lastAccessedGatewayTime_ == null 996 ? com.google.protobuf.Timestamp.getDefaultInstance() 997 : lastAccessedGatewayTime_; 998 } else { 999 return lastAccessedGatewayTimeBuilder_.getMessage(); 1000 } 1001 } 1002 /** 1003 * 1004 * 1005 * <pre> 1006 * [Output only] The most recent time at which the device accessed the gateway 1007 * specified in `last_accessed_gateway`. 1008 * </pre> 1009 * 1010 * <code>.google.protobuf.Timestamp last_accessed_gateway_time = 4;</code> 1011 */ setLastAccessedGatewayTime(com.google.protobuf.Timestamp value)1012 public Builder setLastAccessedGatewayTime(com.google.protobuf.Timestamp value) { 1013 if (lastAccessedGatewayTimeBuilder_ == null) { 1014 if (value == null) { 1015 throw new NullPointerException(); 1016 } 1017 lastAccessedGatewayTime_ = value; 1018 } else { 1019 lastAccessedGatewayTimeBuilder_.setMessage(value); 1020 } 1021 bitField0_ |= 0x00000008; 1022 onChanged(); 1023 return this; 1024 } 1025 /** 1026 * 1027 * 1028 * <pre> 1029 * [Output only] The most recent time at which the device accessed the gateway 1030 * specified in `last_accessed_gateway`. 1031 * </pre> 1032 * 1033 * <code>.google.protobuf.Timestamp last_accessed_gateway_time = 4;</code> 1034 */ setLastAccessedGatewayTime( com.google.protobuf.Timestamp.Builder builderForValue)1035 public Builder setLastAccessedGatewayTime( 1036 com.google.protobuf.Timestamp.Builder builderForValue) { 1037 if (lastAccessedGatewayTimeBuilder_ == null) { 1038 lastAccessedGatewayTime_ = builderForValue.build(); 1039 } else { 1040 lastAccessedGatewayTimeBuilder_.setMessage(builderForValue.build()); 1041 } 1042 bitField0_ |= 0x00000008; 1043 onChanged(); 1044 return this; 1045 } 1046 /** 1047 * 1048 * 1049 * <pre> 1050 * [Output only] The most recent time at which the device accessed the gateway 1051 * specified in `last_accessed_gateway`. 1052 * </pre> 1053 * 1054 * <code>.google.protobuf.Timestamp last_accessed_gateway_time = 4;</code> 1055 */ mergeLastAccessedGatewayTime(com.google.protobuf.Timestamp value)1056 public Builder mergeLastAccessedGatewayTime(com.google.protobuf.Timestamp value) { 1057 if (lastAccessedGatewayTimeBuilder_ == null) { 1058 if (((bitField0_ & 0x00000008) != 0) 1059 && lastAccessedGatewayTime_ != null 1060 && lastAccessedGatewayTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { 1061 getLastAccessedGatewayTimeBuilder().mergeFrom(value); 1062 } else { 1063 lastAccessedGatewayTime_ = value; 1064 } 1065 } else { 1066 lastAccessedGatewayTimeBuilder_.mergeFrom(value); 1067 } 1068 bitField0_ |= 0x00000008; 1069 onChanged(); 1070 return this; 1071 } 1072 /** 1073 * 1074 * 1075 * <pre> 1076 * [Output only] The most recent time at which the device accessed the gateway 1077 * specified in `last_accessed_gateway`. 1078 * </pre> 1079 * 1080 * <code>.google.protobuf.Timestamp last_accessed_gateway_time = 4;</code> 1081 */ clearLastAccessedGatewayTime()1082 public Builder clearLastAccessedGatewayTime() { 1083 bitField0_ = (bitField0_ & ~0x00000008); 1084 lastAccessedGatewayTime_ = null; 1085 if (lastAccessedGatewayTimeBuilder_ != null) { 1086 lastAccessedGatewayTimeBuilder_.dispose(); 1087 lastAccessedGatewayTimeBuilder_ = null; 1088 } 1089 onChanged(); 1090 return this; 1091 } 1092 /** 1093 * 1094 * 1095 * <pre> 1096 * [Output only] The most recent time at which the device accessed the gateway 1097 * specified in `last_accessed_gateway`. 1098 * </pre> 1099 * 1100 * <code>.google.protobuf.Timestamp last_accessed_gateway_time = 4;</code> 1101 */ getLastAccessedGatewayTimeBuilder()1102 public com.google.protobuf.Timestamp.Builder getLastAccessedGatewayTimeBuilder() { 1103 bitField0_ |= 0x00000008; 1104 onChanged(); 1105 return getLastAccessedGatewayTimeFieldBuilder().getBuilder(); 1106 } 1107 /** 1108 * 1109 * 1110 * <pre> 1111 * [Output only] The most recent time at which the device accessed the gateway 1112 * specified in `last_accessed_gateway`. 1113 * </pre> 1114 * 1115 * <code>.google.protobuf.Timestamp last_accessed_gateway_time = 4;</code> 1116 */ getLastAccessedGatewayTimeOrBuilder()1117 public com.google.protobuf.TimestampOrBuilder getLastAccessedGatewayTimeOrBuilder() { 1118 if (lastAccessedGatewayTimeBuilder_ != null) { 1119 return lastAccessedGatewayTimeBuilder_.getMessageOrBuilder(); 1120 } else { 1121 return lastAccessedGatewayTime_ == null 1122 ? com.google.protobuf.Timestamp.getDefaultInstance() 1123 : lastAccessedGatewayTime_; 1124 } 1125 } 1126 /** 1127 * 1128 * 1129 * <pre> 1130 * [Output only] The most recent time at which the device accessed the gateway 1131 * specified in `last_accessed_gateway`. 1132 * </pre> 1133 * 1134 * <code>.google.protobuf.Timestamp last_accessed_gateway_time = 4;</code> 1135 */ 1136 private com.google.protobuf.SingleFieldBuilderV3< 1137 com.google.protobuf.Timestamp, 1138 com.google.protobuf.Timestamp.Builder, 1139 com.google.protobuf.TimestampOrBuilder> getLastAccessedGatewayTimeFieldBuilder()1140 getLastAccessedGatewayTimeFieldBuilder() { 1141 if (lastAccessedGatewayTimeBuilder_ == null) { 1142 lastAccessedGatewayTimeBuilder_ = 1143 new com.google.protobuf.SingleFieldBuilderV3< 1144 com.google.protobuf.Timestamp, 1145 com.google.protobuf.Timestamp.Builder, 1146 com.google.protobuf.TimestampOrBuilder>( 1147 getLastAccessedGatewayTime(), getParentForChildren(), isClean()); 1148 lastAccessedGatewayTime_ = null; 1149 } 1150 return lastAccessedGatewayTimeBuilder_; 1151 } 1152 1153 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1154 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 1155 return super.setUnknownFields(unknownFields); 1156 } 1157 1158 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1159 public final Builder mergeUnknownFields( 1160 final com.google.protobuf.UnknownFieldSet unknownFields) { 1161 return super.mergeUnknownFields(unknownFields); 1162 } 1163 1164 // @@protoc_insertion_point(builder_scope:google.cloud.iot.v1.GatewayConfig) 1165 } 1166 1167 // @@protoc_insertion_point(class_scope:google.cloud.iot.v1.GatewayConfig) 1168 private static final com.google.cloud.iot.v1.GatewayConfig DEFAULT_INSTANCE; 1169 1170 static { 1171 DEFAULT_INSTANCE = new com.google.cloud.iot.v1.GatewayConfig(); 1172 } 1173 getDefaultInstance()1174 public static com.google.cloud.iot.v1.GatewayConfig getDefaultInstance() { 1175 return DEFAULT_INSTANCE; 1176 } 1177 1178 private static final com.google.protobuf.Parser<GatewayConfig> PARSER = 1179 new com.google.protobuf.AbstractParser<GatewayConfig>() { 1180 @java.lang.Override 1181 public GatewayConfig parsePartialFrom( 1182 com.google.protobuf.CodedInputStream input, 1183 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1184 throws com.google.protobuf.InvalidProtocolBufferException { 1185 Builder builder = newBuilder(); 1186 try { 1187 builder.mergeFrom(input, extensionRegistry); 1188 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1189 throw e.setUnfinishedMessage(builder.buildPartial()); 1190 } catch (com.google.protobuf.UninitializedMessageException e) { 1191 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 1192 } catch (java.io.IOException e) { 1193 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1194 .setUnfinishedMessage(builder.buildPartial()); 1195 } 1196 return builder.buildPartial(); 1197 } 1198 }; 1199 parser()1200 public static com.google.protobuf.Parser<GatewayConfig> parser() { 1201 return PARSER; 1202 } 1203 1204 @java.lang.Override getParserForType()1205 public com.google.protobuf.Parser<GatewayConfig> getParserForType() { 1206 return PARSER; 1207 } 1208 1209 @java.lang.Override getDefaultInstanceForType()1210 public com.google.cloud.iot.v1.GatewayConfig getDefaultInstanceForType() { 1211 return DEFAULT_INSTANCE; 1212 } 1213 } 1214