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