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 * Request for `ListDeviceStates`. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.iot.v1.ListDeviceStatesRequest} 29 */ 30 public final class ListDeviceStatesRequest extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.ListDeviceStatesRequest) 33 ListDeviceStatesRequestOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use ListDeviceStatesRequest.newBuilder() to construct. ListDeviceStatesRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private ListDeviceStatesRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 ListDeviceStatesRequest()40 private ListDeviceStatesRequest() { 41 name_ = ""; 42 } 43 44 @java.lang.Override 45 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)46 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 47 return new ListDeviceStatesRequest(); 48 } 49 50 @java.lang.Override getUnknownFields()51 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 52 return this.unknownFields; 53 } 54 getDescriptor()55 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 56 return com.google.cloud.iot.v1.DeviceManagerProto 57 .internal_static_google_cloud_iot_v1_ListDeviceStatesRequest_descriptor; 58 } 59 60 @java.lang.Override 61 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()62 internalGetFieldAccessorTable() { 63 return com.google.cloud.iot.v1.DeviceManagerProto 64 .internal_static_google_cloud_iot_v1_ListDeviceStatesRequest_fieldAccessorTable 65 .ensureFieldAccessorsInitialized( 66 com.google.cloud.iot.v1.ListDeviceStatesRequest.class, 67 com.google.cloud.iot.v1.ListDeviceStatesRequest.Builder.class); 68 } 69 70 public static final int NAME_FIELD_NUMBER = 1; 71 72 @SuppressWarnings("serial") 73 private volatile java.lang.Object name_ = ""; 74 /** 75 * 76 * 77 * <pre> 78 * Required. The name of the device. For example, 79 * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or 80 * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. 81 * </pre> 82 * 83 * <code> 84 * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 85 * </code> 86 * 87 * @return The name. 88 */ 89 @java.lang.Override getName()90 public java.lang.String getName() { 91 java.lang.Object ref = name_; 92 if (ref instanceof java.lang.String) { 93 return (java.lang.String) ref; 94 } else { 95 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 96 java.lang.String s = bs.toStringUtf8(); 97 name_ = s; 98 return s; 99 } 100 } 101 /** 102 * 103 * 104 * <pre> 105 * Required. The name of the device. For example, 106 * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or 107 * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. 108 * </pre> 109 * 110 * <code> 111 * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 112 * </code> 113 * 114 * @return The bytes for name. 115 */ 116 @java.lang.Override getNameBytes()117 public com.google.protobuf.ByteString getNameBytes() { 118 java.lang.Object ref = name_; 119 if (ref instanceof java.lang.String) { 120 com.google.protobuf.ByteString b = 121 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 122 name_ = b; 123 return b; 124 } else { 125 return (com.google.protobuf.ByteString) ref; 126 } 127 } 128 129 public static final int NUM_STATES_FIELD_NUMBER = 2; 130 private int numStates_ = 0; 131 /** 132 * 133 * 134 * <pre> 135 * The number of states to list. States are listed in descending order of 136 * update time. The maximum number of states retained is 10. If this 137 * value is zero, it will return all the states available. 138 * </pre> 139 * 140 * <code>int32 num_states = 2;</code> 141 * 142 * @return The numStates. 143 */ 144 @java.lang.Override getNumStates()145 public int getNumStates() { 146 return numStates_; 147 } 148 149 private byte memoizedIsInitialized = -1; 150 151 @java.lang.Override isInitialized()152 public final boolean isInitialized() { 153 byte isInitialized = memoizedIsInitialized; 154 if (isInitialized == 1) return true; 155 if (isInitialized == 0) return false; 156 157 memoizedIsInitialized = 1; 158 return true; 159 } 160 161 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)162 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 163 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 164 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); 165 } 166 if (numStates_ != 0) { 167 output.writeInt32(2, numStates_); 168 } 169 getUnknownFields().writeTo(output); 170 } 171 172 @java.lang.Override getSerializedSize()173 public int getSerializedSize() { 174 int size = memoizedSize; 175 if (size != -1) return size; 176 177 size = 0; 178 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 179 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); 180 } 181 if (numStates_ != 0) { 182 size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, numStates_); 183 } 184 size += getUnknownFields().getSerializedSize(); 185 memoizedSize = size; 186 return size; 187 } 188 189 @java.lang.Override equals(final java.lang.Object obj)190 public boolean equals(final java.lang.Object obj) { 191 if (obj == this) { 192 return true; 193 } 194 if (!(obj instanceof com.google.cloud.iot.v1.ListDeviceStatesRequest)) { 195 return super.equals(obj); 196 } 197 com.google.cloud.iot.v1.ListDeviceStatesRequest other = 198 (com.google.cloud.iot.v1.ListDeviceStatesRequest) obj; 199 200 if (!getName().equals(other.getName())) return false; 201 if (getNumStates() != other.getNumStates()) return false; 202 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 203 return true; 204 } 205 206 @java.lang.Override hashCode()207 public int hashCode() { 208 if (memoizedHashCode != 0) { 209 return memoizedHashCode; 210 } 211 int hash = 41; 212 hash = (19 * hash) + getDescriptor().hashCode(); 213 hash = (37 * hash) + NAME_FIELD_NUMBER; 214 hash = (53 * hash) + getName().hashCode(); 215 hash = (37 * hash) + NUM_STATES_FIELD_NUMBER; 216 hash = (53 * hash) + getNumStates(); 217 hash = (29 * hash) + getUnknownFields().hashCode(); 218 memoizedHashCode = hash; 219 return hash; 220 } 221 parseFrom(java.nio.ByteBuffer data)222 public static com.google.cloud.iot.v1.ListDeviceStatesRequest parseFrom(java.nio.ByteBuffer data) 223 throws com.google.protobuf.InvalidProtocolBufferException { 224 return PARSER.parseFrom(data); 225 } 226 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)227 public static com.google.cloud.iot.v1.ListDeviceStatesRequest parseFrom( 228 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 229 throws com.google.protobuf.InvalidProtocolBufferException { 230 return PARSER.parseFrom(data, extensionRegistry); 231 } 232 parseFrom( com.google.protobuf.ByteString data)233 public static com.google.cloud.iot.v1.ListDeviceStatesRequest parseFrom( 234 com.google.protobuf.ByteString data) 235 throws com.google.protobuf.InvalidProtocolBufferException { 236 return PARSER.parseFrom(data); 237 } 238 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)239 public static com.google.cloud.iot.v1.ListDeviceStatesRequest parseFrom( 240 com.google.protobuf.ByteString data, 241 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 242 throws com.google.protobuf.InvalidProtocolBufferException { 243 return PARSER.parseFrom(data, extensionRegistry); 244 } 245 parseFrom(byte[] data)246 public static com.google.cloud.iot.v1.ListDeviceStatesRequest parseFrom(byte[] data) 247 throws com.google.protobuf.InvalidProtocolBufferException { 248 return PARSER.parseFrom(data); 249 } 250 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)251 public static com.google.cloud.iot.v1.ListDeviceStatesRequest parseFrom( 252 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 253 throws com.google.protobuf.InvalidProtocolBufferException { 254 return PARSER.parseFrom(data, extensionRegistry); 255 } 256 parseFrom(java.io.InputStream input)257 public static com.google.cloud.iot.v1.ListDeviceStatesRequest parseFrom(java.io.InputStream input) 258 throws java.io.IOException { 259 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 260 } 261 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)262 public static com.google.cloud.iot.v1.ListDeviceStatesRequest parseFrom( 263 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 264 throws java.io.IOException { 265 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 266 PARSER, input, extensionRegistry); 267 } 268 parseDelimitedFrom( java.io.InputStream input)269 public static com.google.cloud.iot.v1.ListDeviceStatesRequest parseDelimitedFrom( 270 java.io.InputStream input) throws java.io.IOException { 271 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 272 } 273 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)274 public static com.google.cloud.iot.v1.ListDeviceStatesRequest parseDelimitedFrom( 275 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 276 throws java.io.IOException { 277 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 278 PARSER, input, extensionRegistry); 279 } 280 parseFrom( com.google.protobuf.CodedInputStream input)281 public static com.google.cloud.iot.v1.ListDeviceStatesRequest parseFrom( 282 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 283 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 284 } 285 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)286 public static com.google.cloud.iot.v1.ListDeviceStatesRequest parseFrom( 287 com.google.protobuf.CodedInputStream input, 288 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 289 throws java.io.IOException { 290 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 291 PARSER, input, extensionRegistry); 292 } 293 294 @java.lang.Override newBuilderForType()295 public Builder newBuilderForType() { 296 return newBuilder(); 297 } 298 newBuilder()299 public static Builder newBuilder() { 300 return DEFAULT_INSTANCE.toBuilder(); 301 } 302 newBuilder(com.google.cloud.iot.v1.ListDeviceStatesRequest prototype)303 public static Builder newBuilder(com.google.cloud.iot.v1.ListDeviceStatesRequest prototype) { 304 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 305 } 306 307 @java.lang.Override toBuilder()308 public Builder toBuilder() { 309 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 310 } 311 312 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)313 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 314 Builder builder = new Builder(parent); 315 return builder; 316 } 317 /** 318 * 319 * 320 * <pre> 321 * Request for `ListDeviceStates`. 322 * </pre> 323 * 324 * Protobuf type {@code google.cloud.iot.v1.ListDeviceStatesRequest} 325 */ 326 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 327 implements 328 // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.ListDeviceStatesRequest) 329 com.google.cloud.iot.v1.ListDeviceStatesRequestOrBuilder { getDescriptor()330 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 331 return com.google.cloud.iot.v1.DeviceManagerProto 332 .internal_static_google_cloud_iot_v1_ListDeviceStatesRequest_descriptor; 333 } 334 335 @java.lang.Override 336 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()337 internalGetFieldAccessorTable() { 338 return com.google.cloud.iot.v1.DeviceManagerProto 339 .internal_static_google_cloud_iot_v1_ListDeviceStatesRequest_fieldAccessorTable 340 .ensureFieldAccessorsInitialized( 341 com.google.cloud.iot.v1.ListDeviceStatesRequest.class, 342 com.google.cloud.iot.v1.ListDeviceStatesRequest.Builder.class); 343 } 344 345 // Construct using com.google.cloud.iot.v1.ListDeviceStatesRequest.newBuilder() Builder()346 private Builder() {} 347 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)348 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 349 super(parent); 350 } 351 352 @java.lang.Override clear()353 public Builder clear() { 354 super.clear(); 355 bitField0_ = 0; 356 name_ = ""; 357 numStates_ = 0; 358 return this; 359 } 360 361 @java.lang.Override getDescriptorForType()362 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 363 return com.google.cloud.iot.v1.DeviceManagerProto 364 .internal_static_google_cloud_iot_v1_ListDeviceStatesRequest_descriptor; 365 } 366 367 @java.lang.Override getDefaultInstanceForType()368 public com.google.cloud.iot.v1.ListDeviceStatesRequest getDefaultInstanceForType() { 369 return com.google.cloud.iot.v1.ListDeviceStatesRequest.getDefaultInstance(); 370 } 371 372 @java.lang.Override build()373 public com.google.cloud.iot.v1.ListDeviceStatesRequest build() { 374 com.google.cloud.iot.v1.ListDeviceStatesRequest result = buildPartial(); 375 if (!result.isInitialized()) { 376 throw newUninitializedMessageException(result); 377 } 378 return result; 379 } 380 381 @java.lang.Override buildPartial()382 public com.google.cloud.iot.v1.ListDeviceStatesRequest buildPartial() { 383 com.google.cloud.iot.v1.ListDeviceStatesRequest result = 384 new com.google.cloud.iot.v1.ListDeviceStatesRequest(this); 385 if (bitField0_ != 0) { 386 buildPartial0(result); 387 } 388 onBuilt(); 389 return result; 390 } 391 buildPartial0(com.google.cloud.iot.v1.ListDeviceStatesRequest result)392 private void buildPartial0(com.google.cloud.iot.v1.ListDeviceStatesRequest result) { 393 int from_bitField0_ = bitField0_; 394 if (((from_bitField0_ & 0x00000001) != 0)) { 395 result.name_ = name_; 396 } 397 if (((from_bitField0_ & 0x00000002) != 0)) { 398 result.numStates_ = numStates_; 399 } 400 } 401 402 @java.lang.Override clone()403 public Builder clone() { 404 return super.clone(); 405 } 406 407 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)408 public Builder setField( 409 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 410 return super.setField(field, value); 411 } 412 413 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)414 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 415 return super.clearField(field); 416 } 417 418 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)419 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 420 return super.clearOneof(oneof); 421 } 422 423 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)424 public Builder setRepeatedField( 425 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 426 return super.setRepeatedField(field, index, value); 427 } 428 429 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)430 public Builder addRepeatedField( 431 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 432 return super.addRepeatedField(field, value); 433 } 434 435 @java.lang.Override mergeFrom(com.google.protobuf.Message other)436 public Builder mergeFrom(com.google.protobuf.Message other) { 437 if (other instanceof com.google.cloud.iot.v1.ListDeviceStatesRequest) { 438 return mergeFrom((com.google.cloud.iot.v1.ListDeviceStatesRequest) other); 439 } else { 440 super.mergeFrom(other); 441 return this; 442 } 443 } 444 mergeFrom(com.google.cloud.iot.v1.ListDeviceStatesRequest other)445 public Builder mergeFrom(com.google.cloud.iot.v1.ListDeviceStatesRequest other) { 446 if (other == com.google.cloud.iot.v1.ListDeviceStatesRequest.getDefaultInstance()) 447 return this; 448 if (!other.getName().isEmpty()) { 449 name_ = other.name_; 450 bitField0_ |= 0x00000001; 451 onChanged(); 452 } 453 if (other.getNumStates() != 0) { 454 setNumStates(other.getNumStates()); 455 } 456 this.mergeUnknownFields(other.getUnknownFields()); 457 onChanged(); 458 return this; 459 } 460 461 @java.lang.Override isInitialized()462 public final boolean isInitialized() { 463 return true; 464 } 465 466 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)467 public Builder mergeFrom( 468 com.google.protobuf.CodedInputStream input, 469 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 470 throws java.io.IOException { 471 if (extensionRegistry == null) { 472 throw new java.lang.NullPointerException(); 473 } 474 try { 475 boolean done = false; 476 while (!done) { 477 int tag = input.readTag(); 478 switch (tag) { 479 case 0: 480 done = true; 481 break; 482 case 10: 483 { 484 name_ = input.readStringRequireUtf8(); 485 bitField0_ |= 0x00000001; 486 break; 487 } // case 10 488 case 16: 489 { 490 numStates_ = input.readInt32(); 491 bitField0_ |= 0x00000002; 492 break; 493 } // case 16 494 default: 495 { 496 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 497 done = true; // was an endgroup tag 498 } 499 break; 500 } // default: 501 } // switch (tag) 502 } // while (!done) 503 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 504 throw e.unwrapIOException(); 505 } finally { 506 onChanged(); 507 } // finally 508 return this; 509 } 510 511 private int bitField0_; 512 513 private java.lang.Object name_ = ""; 514 /** 515 * 516 * 517 * <pre> 518 * Required. The name of the device. For example, 519 * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or 520 * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. 521 * </pre> 522 * 523 * <code> 524 * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 525 * </code> 526 * 527 * @return The name. 528 */ getName()529 public java.lang.String getName() { 530 java.lang.Object ref = name_; 531 if (!(ref instanceof java.lang.String)) { 532 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 533 java.lang.String s = bs.toStringUtf8(); 534 name_ = s; 535 return s; 536 } else { 537 return (java.lang.String) ref; 538 } 539 } 540 /** 541 * 542 * 543 * <pre> 544 * Required. The name of the device. For example, 545 * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or 546 * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. 547 * </pre> 548 * 549 * <code> 550 * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 551 * </code> 552 * 553 * @return The bytes for name. 554 */ getNameBytes()555 public com.google.protobuf.ByteString getNameBytes() { 556 java.lang.Object ref = name_; 557 if (ref instanceof String) { 558 com.google.protobuf.ByteString b = 559 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 560 name_ = b; 561 return b; 562 } else { 563 return (com.google.protobuf.ByteString) ref; 564 } 565 } 566 /** 567 * 568 * 569 * <pre> 570 * Required. The name of the device. For example, 571 * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or 572 * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. 573 * </pre> 574 * 575 * <code> 576 * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 577 * </code> 578 * 579 * @param value The name to set. 580 * @return This builder for chaining. 581 */ setName(java.lang.String value)582 public Builder setName(java.lang.String value) { 583 if (value == null) { 584 throw new NullPointerException(); 585 } 586 name_ = value; 587 bitField0_ |= 0x00000001; 588 onChanged(); 589 return this; 590 } 591 /** 592 * 593 * 594 * <pre> 595 * Required. The name of the device. For example, 596 * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or 597 * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. 598 * </pre> 599 * 600 * <code> 601 * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 602 * </code> 603 * 604 * @return This builder for chaining. 605 */ clearName()606 public Builder clearName() { 607 name_ = getDefaultInstance().getName(); 608 bitField0_ = (bitField0_ & ~0x00000001); 609 onChanged(); 610 return this; 611 } 612 /** 613 * 614 * 615 * <pre> 616 * Required. The name of the device. For example, 617 * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or 618 * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. 619 * </pre> 620 * 621 * <code> 622 * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 623 * </code> 624 * 625 * @param value The bytes for name to set. 626 * @return This builder for chaining. 627 */ setNameBytes(com.google.protobuf.ByteString value)628 public Builder setNameBytes(com.google.protobuf.ByteString value) { 629 if (value == null) { 630 throw new NullPointerException(); 631 } 632 checkByteStringIsUtf8(value); 633 name_ = value; 634 bitField0_ |= 0x00000001; 635 onChanged(); 636 return this; 637 } 638 639 private int numStates_; 640 /** 641 * 642 * 643 * <pre> 644 * The number of states to list. States are listed in descending order of 645 * update time. The maximum number of states retained is 10. If this 646 * value is zero, it will return all the states available. 647 * </pre> 648 * 649 * <code>int32 num_states = 2;</code> 650 * 651 * @return The numStates. 652 */ 653 @java.lang.Override getNumStates()654 public int getNumStates() { 655 return numStates_; 656 } 657 /** 658 * 659 * 660 * <pre> 661 * The number of states to list. States are listed in descending order of 662 * update time. The maximum number of states retained is 10. If this 663 * value is zero, it will return all the states available. 664 * </pre> 665 * 666 * <code>int32 num_states = 2;</code> 667 * 668 * @param value The numStates to set. 669 * @return This builder for chaining. 670 */ setNumStates(int value)671 public Builder setNumStates(int value) { 672 673 numStates_ = value; 674 bitField0_ |= 0x00000002; 675 onChanged(); 676 return this; 677 } 678 /** 679 * 680 * 681 * <pre> 682 * The number of states to list. States are listed in descending order of 683 * update time. The maximum number of states retained is 10. If this 684 * value is zero, it will return all the states available. 685 * </pre> 686 * 687 * <code>int32 num_states = 2;</code> 688 * 689 * @return This builder for chaining. 690 */ clearNumStates()691 public Builder clearNumStates() { 692 bitField0_ = (bitField0_ & ~0x00000002); 693 numStates_ = 0; 694 onChanged(); 695 return this; 696 } 697 698 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)699 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 700 return super.setUnknownFields(unknownFields); 701 } 702 703 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)704 public final Builder mergeUnknownFields( 705 final com.google.protobuf.UnknownFieldSet unknownFields) { 706 return super.mergeUnknownFields(unknownFields); 707 } 708 709 // @@protoc_insertion_point(builder_scope:google.cloud.iot.v1.ListDeviceStatesRequest) 710 } 711 712 // @@protoc_insertion_point(class_scope:google.cloud.iot.v1.ListDeviceStatesRequest) 713 private static final com.google.cloud.iot.v1.ListDeviceStatesRequest DEFAULT_INSTANCE; 714 715 static { 716 DEFAULT_INSTANCE = new com.google.cloud.iot.v1.ListDeviceStatesRequest(); 717 } 718 getDefaultInstance()719 public static com.google.cloud.iot.v1.ListDeviceStatesRequest getDefaultInstance() { 720 return DEFAULT_INSTANCE; 721 } 722 723 private static final com.google.protobuf.Parser<ListDeviceStatesRequest> PARSER = 724 new com.google.protobuf.AbstractParser<ListDeviceStatesRequest>() { 725 @java.lang.Override 726 public ListDeviceStatesRequest parsePartialFrom( 727 com.google.protobuf.CodedInputStream input, 728 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 729 throws com.google.protobuf.InvalidProtocolBufferException { 730 Builder builder = newBuilder(); 731 try { 732 builder.mergeFrom(input, extensionRegistry); 733 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 734 throw e.setUnfinishedMessage(builder.buildPartial()); 735 } catch (com.google.protobuf.UninitializedMessageException e) { 736 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 737 } catch (java.io.IOException e) { 738 throw new com.google.protobuf.InvalidProtocolBufferException(e) 739 .setUnfinishedMessage(builder.buildPartial()); 740 } 741 return builder.buildPartial(); 742 } 743 }; 744 parser()745 public static com.google.protobuf.Parser<ListDeviceStatesRequest> parser() { 746 return PARSER; 747 } 748 749 @java.lang.Override getParserForType()750 public com.google.protobuf.Parser<ListDeviceStatesRequest> getParserForType() { 751 return PARSER; 752 } 753 754 @java.lang.Override getDefaultInstanceForType()755 public com.google.cloud.iot.v1.ListDeviceStatesRequest getDefaultInstanceForType() { 756 return DEFAULT_INSTANCE; 757 } 758 } 759