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/compute/v1/compute.proto 18 19 package com.google.cloud.compute.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * Message containing connection draining configuration. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.compute.v1.ConnectionDraining} 29 */ 30 public final class ConnectionDraining extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.ConnectionDraining) 33 ConnectionDrainingOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use ConnectionDraining.newBuilder() to construct. ConnectionDraining(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private ConnectionDraining(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 ConnectionDraining()40 private ConnectionDraining() {} 41 42 @java.lang.Override 43 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)44 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 45 return new ConnectionDraining(); 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.compute.v1.Compute 55 .internal_static_google_cloud_compute_v1_ConnectionDraining_descriptor; 56 } 57 58 @java.lang.Override 59 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()60 internalGetFieldAccessorTable() { 61 return com.google.cloud.compute.v1.Compute 62 .internal_static_google_cloud_compute_v1_ConnectionDraining_fieldAccessorTable 63 .ensureFieldAccessorsInitialized( 64 com.google.cloud.compute.v1.ConnectionDraining.class, 65 com.google.cloud.compute.v1.ConnectionDraining.Builder.class); 66 } 67 68 private int bitField0_; 69 public static final int DRAINING_TIMEOUT_SEC_FIELD_NUMBER = 225127070; 70 private int drainingTimeoutSec_ = 0; 71 /** 72 * 73 * 74 * <pre> 75 * Configures a duration timeout for existing requests on a removed backend instance. For supported load balancers and protocols, as described in Enabling connection draining. 76 * </pre> 77 * 78 * <code>optional int32 draining_timeout_sec = 225127070;</code> 79 * 80 * @return Whether the drainingTimeoutSec field is set. 81 */ 82 @java.lang.Override hasDrainingTimeoutSec()83 public boolean hasDrainingTimeoutSec() { 84 return ((bitField0_ & 0x00000001) != 0); 85 } 86 /** 87 * 88 * 89 * <pre> 90 * Configures a duration timeout for existing requests on a removed backend instance. For supported load balancers and protocols, as described in Enabling connection draining. 91 * </pre> 92 * 93 * <code>optional int32 draining_timeout_sec = 225127070;</code> 94 * 95 * @return The drainingTimeoutSec. 96 */ 97 @java.lang.Override getDrainingTimeoutSec()98 public int getDrainingTimeoutSec() { 99 return drainingTimeoutSec_; 100 } 101 102 private byte memoizedIsInitialized = -1; 103 104 @java.lang.Override isInitialized()105 public final boolean isInitialized() { 106 byte isInitialized = memoizedIsInitialized; 107 if (isInitialized == 1) return true; 108 if (isInitialized == 0) return false; 109 110 memoizedIsInitialized = 1; 111 return true; 112 } 113 114 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)115 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 116 if (((bitField0_ & 0x00000001) != 0)) { 117 output.writeInt32(225127070, drainingTimeoutSec_); 118 } 119 getUnknownFields().writeTo(output); 120 } 121 122 @java.lang.Override getSerializedSize()123 public int getSerializedSize() { 124 int size = memoizedSize; 125 if (size != -1) return size; 126 127 size = 0; 128 if (((bitField0_ & 0x00000001) != 0)) { 129 size += 130 com.google.protobuf.CodedOutputStream.computeInt32Size(225127070, drainingTimeoutSec_); 131 } 132 size += getUnknownFields().getSerializedSize(); 133 memoizedSize = size; 134 return size; 135 } 136 137 @java.lang.Override equals(final java.lang.Object obj)138 public boolean equals(final java.lang.Object obj) { 139 if (obj == this) { 140 return true; 141 } 142 if (!(obj instanceof com.google.cloud.compute.v1.ConnectionDraining)) { 143 return super.equals(obj); 144 } 145 com.google.cloud.compute.v1.ConnectionDraining other = 146 (com.google.cloud.compute.v1.ConnectionDraining) obj; 147 148 if (hasDrainingTimeoutSec() != other.hasDrainingTimeoutSec()) return false; 149 if (hasDrainingTimeoutSec()) { 150 if (getDrainingTimeoutSec() != other.getDrainingTimeoutSec()) return false; 151 } 152 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 153 return true; 154 } 155 156 @java.lang.Override hashCode()157 public int hashCode() { 158 if (memoizedHashCode != 0) { 159 return memoizedHashCode; 160 } 161 int hash = 41; 162 hash = (19 * hash) + getDescriptor().hashCode(); 163 if (hasDrainingTimeoutSec()) { 164 hash = (37 * hash) + DRAINING_TIMEOUT_SEC_FIELD_NUMBER; 165 hash = (53 * hash) + getDrainingTimeoutSec(); 166 } 167 hash = (29 * hash) + getUnknownFields().hashCode(); 168 memoizedHashCode = hash; 169 return hash; 170 } 171 parseFrom(java.nio.ByteBuffer data)172 public static com.google.cloud.compute.v1.ConnectionDraining parseFrom(java.nio.ByteBuffer data) 173 throws com.google.protobuf.InvalidProtocolBufferException { 174 return PARSER.parseFrom(data); 175 } 176 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)177 public static com.google.cloud.compute.v1.ConnectionDraining parseFrom( 178 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 179 throws com.google.protobuf.InvalidProtocolBufferException { 180 return PARSER.parseFrom(data, extensionRegistry); 181 } 182 parseFrom( com.google.protobuf.ByteString data)183 public static com.google.cloud.compute.v1.ConnectionDraining parseFrom( 184 com.google.protobuf.ByteString data) 185 throws com.google.protobuf.InvalidProtocolBufferException { 186 return PARSER.parseFrom(data); 187 } 188 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)189 public static com.google.cloud.compute.v1.ConnectionDraining parseFrom( 190 com.google.protobuf.ByteString data, 191 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 192 throws com.google.protobuf.InvalidProtocolBufferException { 193 return PARSER.parseFrom(data, extensionRegistry); 194 } 195 parseFrom(byte[] data)196 public static com.google.cloud.compute.v1.ConnectionDraining parseFrom(byte[] data) 197 throws com.google.protobuf.InvalidProtocolBufferException { 198 return PARSER.parseFrom(data); 199 } 200 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)201 public static com.google.cloud.compute.v1.ConnectionDraining parseFrom( 202 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 203 throws com.google.protobuf.InvalidProtocolBufferException { 204 return PARSER.parseFrom(data, extensionRegistry); 205 } 206 parseFrom(java.io.InputStream input)207 public static com.google.cloud.compute.v1.ConnectionDraining parseFrom(java.io.InputStream input) 208 throws java.io.IOException { 209 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 210 } 211 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)212 public static com.google.cloud.compute.v1.ConnectionDraining parseFrom( 213 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 214 throws java.io.IOException { 215 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 216 PARSER, input, extensionRegistry); 217 } 218 parseDelimitedFrom( java.io.InputStream input)219 public static com.google.cloud.compute.v1.ConnectionDraining parseDelimitedFrom( 220 java.io.InputStream input) throws java.io.IOException { 221 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 222 } 223 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)224 public static com.google.cloud.compute.v1.ConnectionDraining parseDelimitedFrom( 225 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 226 throws java.io.IOException { 227 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 228 PARSER, input, extensionRegistry); 229 } 230 parseFrom( com.google.protobuf.CodedInputStream input)231 public static com.google.cloud.compute.v1.ConnectionDraining parseFrom( 232 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 233 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 234 } 235 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)236 public static com.google.cloud.compute.v1.ConnectionDraining parseFrom( 237 com.google.protobuf.CodedInputStream input, 238 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 239 throws java.io.IOException { 240 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 241 PARSER, input, extensionRegistry); 242 } 243 244 @java.lang.Override newBuilderForType()245 public Builder newBuilderForType() { 246 return newBuilder(); 247 } 248 newBuilder()249 public static Builder newBuilder() { 250 return DEFAULT_INSTANCE.toBuilder(); 251 } 252 newBuilder(com.google.cloud.compute.v1.ConnectionDraining prototype)253 public static Builder newBuilder(com.google.cloud.compute.v1.ConnectionDraining prototype) { 254 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 255 } 256 257 @java.lang.Override toBuilder()258 public Builder toBuilder() { 259 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 260 } 261 262 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)263 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 264 Builder builder = new Builder(parent); 265 return builder; 266 } 267 /** 268 * 269 * 270 * <pre> 271 * Message containing connection draining configuration. 272 * </pre> 273 * 274 * Protobuf type {@code google.cloud.compute.v1.ConnectionDraining} 275 */ 276 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 277 implements 278 // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.ConnectionDraining) 279 com.google.cloud.compute.v1.ConnectionDrainingOrBuilder { getDescriptor()280 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 281 return com.google.cloud.compute.v1.Compute 282 .internal_static_google_cloud_compute_v1_ConnectionDraining_descriptor; 283 } 284 285 @java.lang.Override 286 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()287 internalGetFieldAccessorTable() { 288 return com.google.cloud.compute.v1.Compute 289 .internal_static_google_cloud_compute_v1_ConnectionDraining_fieldAccessorTable 290 .ensureFieldAccessorsInitialized( 291 com.google.cloud.compute.v1.ConnectionDraining.class, 292 com.google.cloud.compute.v1.ConnectionDraining.Builder.class); 293 } 294 295 // Construct using com.google.cloud.compute.v1.ConnectionDraining.newBuilder() Builder()296 private Builder() {} 297 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)298 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 299 super(parent); 300 } 301 302 @java.lang.Override clear()303 public Builder clear() { 304 super.clear(); 305 bitField0_ = 0; 306 drainingTimeoutSec_ = 0; 307 return this; 308 } 309 310 @java.lang.Override getDescriptorForType()311 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 312 return com.google.cloud.compute.v1.Compute 313 .internal_static_google_cloud_compute_v1_ConnectionDraining_descriptor; 314 } 315 316 @java.lang.Override getDefaultInstanceForType()317 public com.google.cloud.compute.v1.ConnectionDraining getDefaultInstanceForType() { 318 return com.google.cloud.compute.v1.ConnectionDraining.getDefaultInstance(); 319 } 320 321 @java.lang.Override build()322 public com.google.cloud.compute.v1.ConnectionDraining build() { 323 com.google.cloud.compute.v1.ConnectionDraining result = buildPartial(); 324 if (!result.isInitialized()) { 325 throw newUninitializedMessageException(result); 326 } 327 return result; 328 } 329 330 @java.lang.Override buildPartial()331 public com.google.cloud.compute.v1.ConnectionDraining buildPartial() { 332 com.google.cloud.compute.v1.ConnectionDraining result = 333 new com.google.cloud.compute.v1.ConnectionDraining(this); 334 if (bitField0_ != 0) { 335 buildPartial0(result); 336 } 337 onBuilt(); 338 return result; 339 } 340 buildPartial0(com.google.cloud.compute.v1.ConnectionDraining result)341 private void buildPartial0(com.google.cloud.compute.v1.ConnectionDraining result) { 342 int from_bitField0_ = bitField0_; 343 int to_bitField0_ = 0; 344 if (((from_bitField0_ & 0x00000001) != 0)) { 345 result.drainingTimeoutSec_ = drainingTimeoutSec_; 346 to_bitField0_ |= 0x00000001; 347 } 348 result.bitField0_ |= to_bitField0_; 349 } 350 351 @java.lang.Override clone()352 public Builder clone() { 353 return super.clone(); 354 } 355 356 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)357 public Builder setField( 358 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 359 return super.setField(field, value); 360 } 361 362 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)363 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 364 return super.clearField(field); 365 } 366 367 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)368 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 369 return super.clearOneof(oneof); 370 } 371 372 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)373 public Builder setRepeatedField( 374 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 375 return super.setRepeatedField(field, index, value); 376 } 377 378 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)379 public Builder addRepeatedField( 380 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 381 return super.addRepeatedField(field, value); 382 } 383 384 @java.lang.Override mergeFrom(com.google.protobuf.Message other)385 public Builder mergeFrom(com.google.protobuf.Message other) { 386 if (other instanceof com.google.cloud.compute.v1.ConnectionDraining) { 387 return mergeFrom((com.google.cloud.compute.v1.ConnectionDraining) other); 388 } else { 389 super.mergeFrom(other); 390 return this; 391 } 392 } 393 mergeFrom(com.google.cloud.compute.v1.ConnectionDraining other)394 public Builder mergeFrom(com.google.cloud.compute.v1.ConnectionDraining other) { 395 if (other == com.google.cloud.compute.v1.ConnectionDraining.getDefaultInstance()) return this; 396 if (other.hasDrainingTimeoutSec()) { 397 setDrainingTimeoutSec(other.getDrainingTimeoutSec()); 398 } 399 this.mergeUnknownFields(other.getUnknownFields()); 400 onChanged(); 401 return this; 402 } 403 404 @java.lang.Override isInitialized()405 public final boolean isInitialized() { 406 return true; 407 } 408 409 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)410 public Builder mergeFrom( 411 com.google.protobuf.CodedInputStream input, 412 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 413 throws java.io.IOException { 414 if (extensionRegistry == null) { 415 throw new java.lang.NullPointerException(); 416 } 417 try { 418 boolean done = false; 419 while (!done) { 420 int tag = input.readTag(); 421 switch (tag) { 422 case 0: 423 done = true; 424 break; 425 case 1801016560: 426 { 427 drainingTimeoutSec_ = input.readInt32(); 428 bitField0_ |= 0x00000001; 429 break; 430 } // case 1801016560 431 default: 432 { 433 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 434 done = true; // was an endgroup tag 435 } 436 break; 437 } // default: 438 } // switch (tag) 439 } // while (!done) 440 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 441 throw e.unwrapIOException(); 442 } finally { 443 onChanged(); 444 } // finally 445 return this; 446 } 447 448 private int bitField0_; 449 450 private int drainingTimeoutSec_; 451 /** 452 * 453 * 454 * <pre> 455 * Configures a duration timeout for existing requests on a removed backend instance. For supported load balancers and protocols, as described in Enabling connection draining. 456 * </pre> 457 * 458 * <code>optional int32 draining_timeout_sec = 225127070;</code> 459 * 460 * @return Whether the drainingTimeoutSec field is set. 461 */ 462 @java.lang.Override hasDrainingTimeoutSec()463 public boolean hasDrainingTimeoutSec() { 464 return ((bitField0_ & 0x00000001) != 0); 465 } 466 /** 467 * 468 * 469 * <pre> 470 * Configures a duration timeout for existing requests on a removed backend instance. For supported load balancers and protocols, as described in Enabling connection draining. 471 * </pre> 472 * 473 * <code>optional int32 draining_timeout_sec = 225127070;</code> 474 * 475 * @return The drainingTimeoutSec. 476 */ 477 @java.lang.Override getDrainingTimeoutSec()478 public int getDrainingTimeoutSec() { 479 return drainingTimeoutSec_; 480 } 481 /** 482 * 483 * 484 * <pre> 485 * Configures a duration timeout for existing requests on a removed backend instance. For supported load balancers and protocols, as described in Enabling connection draining. 486 * </pre> 487 * 488 * <code>optional int32 draining_timeout_sec = 225127070;</code> 489 * 490 * @param value The drainingTimeoutSec to set. 491 * @return This builder for chaining. 492 */ setDrainingTimeoutSec(int value)493 public Builder setDrainingTimeoutSec(int value) { 494 495 drainingTimeoutSec_ = value; 496 bitField0_ |= 0x00000001; 497 onChanged(); 498 return this; 499 } 500 /** 501 * 502 * 503 * <pre> 504 * Configures a duration timeout for existing requests on a removed backend instance. For supported load balancers and protocols, as described in Enabling connection draining. 505 * </pre> 506 * 507 * <code>optional int32 draining_timeout_sec = 225127070;</code> 508 * 509 * @return This builder for chaining. 510 */ clearDrainingTimeoutSec()511 public Builder clearDrainingTimeoutSec() { 512 bitField0_ = (bitField0_ & ~0x00000001); 513 drainingTimeoutSec_ = 0; 514 onChanged(); 515 return this; 516 } 517 518 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)519 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 520 return super.setUnknownFields(unknownFields); 521 } 522 523 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)524 public final Builder mergeUnknownFields( 525 final com.google.protobuf.UnknownFieldSet unknownFields) { 526 return super.mergeUnknownFields(unknownFields); 527 } 528 529 // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.ConnectionDraining) 530 } 531 532 // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.ConnectionDraining) 533 private static final com.google.cloud.compute.v1.ConnectionDraining DEFAULT_INSTANCE; 534 535 static { 536 DEFAULT_INSTANCE = new com.google.cloud.compute.v1.ConnectionDraining(); 537 } 538 getDefaultInstance()539 public static com.google.cloud.compute.v1.ConnectionDraining getDefaultInstance() { 540 return DEFAULT_INSTANCE; 541 } 542 543 private static final com.google.protobuf.Parser<ConnectionDraining> PARSER = 544 new com.google.protobuf.AbstractParser<ConnectionDraining>() { 545 @java.lang.Override 546 public ConnectionDraining parsePartialFrom( 547 com.google.protobuf.CodedInputStream input, 548 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 549 throws com.google.protobuf.InvalidProtocolBufferException { 550 Builder builder = newBuilder(); 551 try { 552 builder.mergeFrom(input, extensionRegistry); 553 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 554 throw e.setUnfinishedMessage(builder.buildPartial()); 555 } catch (com.google.protobuf.UninitializedMessageException e) { 556 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 557 } catch (java.io.IOException e) { 558 throw new com.google.protobuf.InvalidProtocolBufferException(e) 559 .setUnfinishedMessage(builder.buildPartial()); 560 } 561 return builder.buildPartial(); 562 } 563 }; 564 parser()565 public static com.google.protobuf.Parser<ConnectionDraining> parser() { 566 return PARSER; 567 } 568 569 @java.lang.Override getParserForType()570 public com.google.protobuf.Parser<ConnectionDraining> getParserForType() { 571 return PARSER; 572 } 573 574 @java.lang.Override getDefaultInstanceForType()575 public com.google.cloud.compute.v1.ConnectionDraining getDefaultInstanceForType() { 576 return DEFAULT_INSTANCE; 577 } 578 } 579