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 * Encapsulates numeric value that can be either absolute or relative. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.compute.v1.FixedOrPercent} 29 */ 30 public final class FixedOrPercent extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.FixedOrPercent) 33 FixedOrPercentOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use FixedOrPercent.newBuilder() to construct. FixedOrPercent(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private FixedOrPercent(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 FixedOrPercent()40 private FixedOrPercent() {} 41 42 @java.lang.Override 43 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)44 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 45 return new FixedOrPercent(); 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_FixedOrPercent_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_FixedOrPercent_fieldAccessorTable 63 .ensureFieldAccessorsInitialized( 64 com.google.cloud.compute.v1.FixedOrPercent.class, 65 com.google.cloud.compute.v1.FixedOrPercent.Builder.class); 66 } 67 68 private int bitField0_; 69 public static final int CALCULATED_FIELD_NUMBER = 472082878; 70 private int calculated_ = 0; 71 /** 72 * 73 * 74 * <pre> 75 * [Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded. 76 * </pre> 77 * 78 * <code>optional int32 calculated = 472082878;</code> 79 * 80 * @return Whether the calculated field is set. 81 */ 82 @java.lang.Override hasCalculated()83 public boolean hasCalculated() { 84 return ((bitField0_ & 0x00000001) != 0); 85 } 86 /** 87 * 88 * 89 * <pre> 90 * [Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded. 91 * </pre> 92 * 93 * <code>optional int32 calculated = 472082878;</code> 94 * 95 * @return The calculated. 96 */ 97 @java.lang.Override getCalculated()98 public int getCalculated() { 99 return calculated_; 100 } 101 102 public static final int FIXED_FIELD_NUMBER = 97445748; 103 private int fixed_ = 0; 104 /** 105 * 106 * 107 * <pre> 108 * Specifies a fixed number of VM instances. This must be a positive integer. 109 * </pre> 110 * 111 * <code>optional int32 fixed = 97445748;</code> 112 * 113 * @return Whether the fixed field is set. 114 */ 115 @java.lang.Override hasFixed()116 public boolean hasFixed() { 117 return ((bitField0_ & 0x00000002) != 0); 118 } 119 /** 120 * 121 * 122 * <pre> 123 * Specifies a fixed number of VM instances. This must be a positive integer. 124 * </pre> 125 * 126 * <code>optional int32 fixed = 97445748;</code> 127 * 128 * @return The fixed. 129 */ 130 @java.lang.Override getFixed()131 public int getFixed() { 132 return fixed_; 133 } 134 135 public static final int PERCENT_FIELD_NUMBER = 394814533; 136 private int percent_ = 0; 137 /** 138 * 139 * 140 * <pre> 141 * Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. 142 * </pre> 143 * 144 * <code>optional int32 percent = 394814533;</code> 145 * 146 * @return Whether the percent field is set. 147 */ 148 @java.lang.Override hasPercent()149 public boolean hasPercent() { 150 return ((bitField0_ & 0x00000004) != 0); 151 } 152 /** 153 * 154 * 155 * <pre> 156 * Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. 157 * </pre> 158 * 159 * <code>optional int32 percent = 394814533;</code> 160 * 161 * @return The percent. 162 */ 163 @java.lang.Override getPercent()164 public int getPercent() { 165 return percent_; 166 } 167 168 private byte memoizedIsInitialized = -1; 169 170 @java.lang.Override isInitialized()171 public final boolean isInitialized() { 172 byte isInitialized = memoizedIsInitialized; 173 if (isInitialized == 1) return true; 174 if (isInitialized == 0) return false; 175 176 memoizedIsInitialized = 1; 177 return true; 178 } 179 180 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)181 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 182 if (((bitField0_ & 0x00000002) != 0)) { 183 output.writeInt32(97445748, fixed_); 184 } 185 if (((bitField0_ & 0x00000004) != 0)) { 186 output.writeInt32(394814533, percent_); 187 } 188 if (((bitField0_ & 0x00000001) != 0)) { 189 output.writeInt32(472082878, calculated_); 190 } 191 getUnknownFields().writeTo(output); 192 } 193 194 @java.lang.Override getSerializedSize()195 public int getSerializedSize() { 196 int size = memoizedSize; 197 if (size != -1) return size; 198 199 size = 0; 200 if (((bitField0_ & 0x00000002) != 0)) { 201 size += com.google.protobuf.CodedOutputStream.computeInt32Size(97445748, fixed_); 202 } 203 if (((bitField0_ & 0x00000004) != 0)) { 204 size += com.google.protobuf.CodedOutputStream.computeInt32Size(394814533, percent_); 205 } 206 if (((bitField0_ & 0x00000001) != 0)) { 207 size += com.google.protobuf.CodedOutputStream.computeInt32Size(472082878, calculated_); 208 } 209 size += getUnknownFields().getSerializedSize(); 210 memoizedSize = size; 211 return size; 212 } 213 214 @java.lang.Override equals(final java.lang.Object obj)215 public boolean equals(final java.lang.Object obj) { 216 if (obj == this) { 217 return true; 218 } 219 if (!(obj instanceof com.google.cloud.compute.v1.FixedOrPercent)) { 220 return super.equals(obj); 221 } 222 com.google.cloud.compute.v1.FixedOrPercent other = 223 (com.google.cloud.compute.v1.FixedOrPercent) obj; 224 225 if (hasCalculated() != other.hasCalculated()) return false; 226 if (hasCalculated()) { 227 if (getCalculated() != other.getCalculated()) return false; 228 } 229 if (hasFixed() != other.hasFixed()) return false; 230 if (hasFixed()) { 231 if (getFixed() != other.getFixed()) return false; 232 } 233 if (hasPercent() != other.hasPercent()) return false; 234 if (hasPercent()) { 235 if (getPercent() != other.getPercent()) return false; 236 } 237 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 238 return true; 239 } 240 241 @java.lang.Override hashCode()242 public int hashCode() { 243 if (memoizedHashCode != 0) { 244 return memoizedHashCode; 245 } 246 int hash = 41; 247 hash = (19 * hash) + getDescriptor().hashCode(); 248 if (hasCalculated()) { 249 hash = (37 * hash) + CALCULATED_FIELD_NUMBER; 250 hash = (53 * hash) + getCalculated(); 251 } 252 if (hasFixed()) { 253 hash = (37 * hash) + FIXED_FIELD_NUMBER; 254 hash = (53 * hash) + getFixed(); 255 } 256 if (hasPercent()) { 257 hash = (37 * hash) + PERCENT_FIELD_NUMBER; 258 hash = (53 * hash) + getPercent(); 259 } 260 hash = (29 * hash) + getUnknownFields().hashCode(); 261 memoizedHashCode = hash; 262 return hash; 263 } 264 parseFrom(java.nio.ByteBuffer data)265 public static com.google.cloud.compute.v1.FixedOrPercent parseFrom(java.nio.ByteBuffer data) 266 throws com.google.protobuf.InvalidProtocolBufferException { 267 return PARSER.parseFrom(data); 268 } 269 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)270 public static com.google.cloud.compute.v1.FixedOrPercent parseFrom( 271 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 272 throws com.google.protobuf.InvalidProtocolBufferException { 273 return PARSER.parseFrom(data, extensionRegistry); 274 } 275 parseFrom( com.google.protobuf.ByteString data)276 public static com.google.cloud.compute.v1.FixedOrPercent parseFrom( 277 com.google.protobuf.ByteString data) 278 throws com.google.protobuf.InvalidProtocolBufferException { 279 return PARSER.parseFrom(data); 280 } 281 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)282 public static com.google.cloud.compute.v1.FixedOrPercent parseFrom( 283 com.google.protobuf.ByteString data, 284 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 285 throws com.google.protobuf.InvalidProtocolBufferException { 286 return PARSER.parseFrom(data, extensionRegistry); 287 } 288 parseFrom(byte[] data)289 public static com.google.cloud.compute.v1.FixedOrPercent parseFrom(byte[] data) 290 throws com.google.protobuf.InvalidProtocolBufferException { 291 return PARSER.parseFrom(data); 292 } 293 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)294 public static com.google.cloud.compute.v1.FixedOrPercent parseFrom( 295 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 296 throws com.google.protobuf.InvalidProtocolBufferException { 297 return PARSER.parseFrom(data, extensionRegistry); 298 } 299 parseFrom(java.io.InputStream input)300 public static com.google.cloud.compute.v1.FixedOrPercent parseFrom(java.io.InputStream input) 301 throws java.io.IOException { 302 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 303 } 304 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)305 public static com.google.cloud.compute.v1.FixedOrPercent parseFrom( 306 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 307 throws java.io.IOException { 308 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 309 PARSER, input, extensionRegistry); 310 } 311 parseDelimitedFrom( java.io.InputStream input)312 public static com.google.cloud.compute.v1.FixedOrPercent parseDelimitedFrom( 313 java.io.InputStream input) throws java.io.IOException { 314 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 315 } 316 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)317 public static com.google.cloud.compute.v1.FixedOrPercent parseDelimitedFrom( 318 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 319 throws java.io.IOException { 320 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 321 PARSER, input, extensionRegistry); 322 } 323 parseFrom( com.google.protobuf.CodedInputStream input)324 public static com.google.cloud.compute.v1.FixedOrPercent parseFrom( 325 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 326 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 327 } 328 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)329 public static com.google.cloud.compute.v1.FixedOrPercent parseFrom( 330 com.google.protobuf.CodedInputStream input, 331 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 332 throws java.io.IOException { 333 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 334 PARSER, input, extensionRegistry); 335 } 336 337 @java.lang.Override newBuilderForType()338 public Builder newBuilderForType() { 339 return newBuilder(); 340 } 341 newBuilder()342 public static Builder newBuilder() { 343 return DEFAULT_INSTANCE.toBuilder(); 344 } 345 newBuilder(com.google.cloud.compute.v1.FixedOrPercent prototype)346 public static Builder newBuilder(com.google.cloud.compute.v1.FixedOrPercent prototype) { 347 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 348 } 349 350 @java.lang.Override toBuilder()351 public Builder toBuilder() { 352 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 353 } 354 355 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)356 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 357 Builder builder = new Builder(parent); 358 return builder; 359 } 360 /** 361 * 362 * 363 * <pre> 364 * Encapsulates numeric value that can be either absolute or relative. 365 * </pre> 366 * 367 * Protobuf type {@code google.cloud.compute.v1.FixedOrPercent} 368 */ 369 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 370 implements 371 // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.FixedOrPercent) 372 com.google.cloud.compute.v1.FixedOrPercentOrBuilder { getDescriptor()373 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 374 return com.google.cloud.compute.v1.Compute 375 .internal_static_google_cloud_compute_v1_FixedOrPercent_descriptor; 376 } 377 378 @java.lang.Override 379 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()380 internalGetFieldAccessorTable() { 381 return com.google.cloud.compute.v1.Compute 382 .internal_static_google_cloud_compute_v1_FixedOrPercent_fieldAccessorTable 383 .ensureFieldAccessorsInitialized( 384 com.google.cloud.compute.v1.FixedOrPercent.class, 385 com.google.cloud.compute.v1.FixedOrPercent.Builder.class); 386 } 387 388 // Construct using com.google.cloud.compute.v1.FixedOrPercent.newBuilder() Builder()389 private Builder() {} 390 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)391 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 392 super(parent); 393 } 394 395 @java.lang.Override clear()396 public Builder clear() { 397 super.clear(); 398 bitField0_ = 0; 399 calculated_ = 0; 400 fixed_ = 0; 401 percent_ = 0; 402 return this; 403 } 404 405 @java.lang.Override getDescriptorForType()406 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 407 return com.google.cloud.compute.v1.Compute 408 .internal_static_google_cloud_compute_v1_FixedOrPercent_descriptor; 409 } 410 411 @java.lang.Override getDefaultInstanceForType()412 public com.google.cloud.compute.v1.FixedOrPercent getDefaultInstanceForType() { 413 return com.google.cloud.compute.v1.FixedOrPercent.getDefaultInstance(); 414 } 415 416 @java.lang.Override build()417 public com.google.cloud.compute.v1.FixedOrPercent build() { 418 com.google.cloud.compute.v1.FixedOrPercent result = buildPartial(); 419 if (!result.isInitialized()) { 420 throw newUninitializedMessageException(result); 421 } 422 return result; 423 } 424 425 @java.lang.Override buildPartial()426 public com.google.cloud.compute.v1.FixedOrPercent buildPartial() { 427 com.google.cloud.compute.v1.FixedOrPercent result = 428 new com.google.cloud.compute.v1.FixedOrPercent(this); 429 if (bitField0_ != 0) { 430 buildPartial0(result); 431 } 432 onBuilt(); 433 return result; 434 } 435 buildPartial0(com.google.cloud.compute.v1.FixedOrPercent result)436 private void buildPartial0(com.google.cloud.compute.v1.FixedOrPercent result) { 437 int from_bitField0_ = bitField0_; 438 int to_bitField0_ = 0; 439 if (((from_bitField0_ & 0x00000001) != 0)) { 440 result.calculated_ = calculated_; 441 to_bitField0_ |= 0x00000001; 442 } 443 if (((from_bitField0_ & 0x00000002) != 0)) { 444 result.fixed_ = fixed_; 445 to_bitField0_ |= 0x00000002; 446 } 447 if (((from_bitField0_ & 0x00000004) != 0)) { 448 result.percent_ = percent_; 449 to_bitField0_ |= 0x00000004; 450 } 451 result.bitField0_ |= to_bitField0_; 452 } 453 454 @java.lang.Override clone()455 public Builder clone() { 456 return super.clone(); 457 } 458 459 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)460 public Builder setField( 461 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 462 return super.setField(field, value); 463 } 464 465 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)466 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 467 return super.clearField(field); 468 } 469 470 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)471 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 472 return super.clearOneof(oneof); 473 } 474 475 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)476 public Builder setRepeatedField( 477 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 478 return super.setRepeatedField(field, index, value); 479 } 480 481 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)482 public Builder addRepeatedField( 483 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 484 return super.addRepeatedField(field, value); 485 } 486 487 @java.lang.Override mergeFrom(com.google.protobuf.Message other)488 public Builder mergeFrom(com.google.protobuf.Message other) { 489 if (other instanceof com.google.cloud.compute.v1.FixedOrPercent) { 490 return mergeFrom((com.google.cloud.compute.v1.FixedOrPercent) other); 491 } else { 492 super.mergeFrom(other); 493 return this; 494 } 495 } 496 mergeFrom(com.google.cloud.compute.v1.FixedOrPercent other)497 public Builder mergeFrom(com.google.cloud.compute.v1.FixedOrPercent other) { 498 if (other == com.google.cloud.compute.v1.FixedOrPercent.getDefaultInstance()) return this; 499 if (other.hasCalculated()) { 500 setCalculated(other.getCalculated()); 501 } 502 if (other.hasFixed()) { 503 setFixed(other.getFixed()); 504 } 505 if (other.hasPercent()) { 506 setPercent(other.getPercent()); 507 } 508 this.mergeUnknownFields(other.getUnknownFields()); 509 onChanged(); 510 return this; 511 } 512 513 @java.lang.Override isInitialized()514 public final boolean isInitialized() { 515 return true; 516 } 517 518 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)519 public Builder mergeFrom( 520 com.google.protobuf.CodedInputStream input, 521 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 522 throws java.io.IOException { 523 if (extensionRegistry == null) { 524 throw new java.lang.NullPointerException(); 525 } 526 try { 527 boolean done = false; 528 while (!done) { 529 int tag = input.readTag(); 530 switch (tag) { 531 case 0: 532 done = true; 533 break; 534 case 779565984: 535 { 536 fixed_ = input.readInt32(); 537 bitField0_ |= 0x00000002; 538 break; 539 } // case 779565984 540 case -1136451032: 541 { 542 percent_ = input.readInt32(); 543 bitField0_ |= 0x00000004; 544 break; 545 } // case -1136451032 546 case -518304272: 547 { 548 calculated_ = input.readInt32(); 549 bitField0_ |= 0x00000001; 550 break; 551 } // case -518304272 552 default: 553 { 554 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 555 done = true; // was an endgroup tag 556 } 557 break; 558 } // default: 559 } // switch (tag) 560 } // while (!done) 561 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 562 throw e.unwrapIOException(); 563 } finally { 564 onChanged(); 565 } // finally 566 return this; 567 } 568 569 private int bitField0_; 570 571 private int calculated_; 572 /** 573 * 574 * 575 * <pre> 576 * [Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded. 577 * </pre> 578 * 579 * <code>optional int32 calculated = 472082878;</code> 580 * 581 * @return Whether the calculated field is set. 582 */ 583 @java.lang.Override hasCalculated()584 public boolean hasCalculated() { 585 return ((bitField0_ & 0x00000001) != 0); 586 } 587 /** 588 * 589 * 590 * <pre> 591 * [Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded. 592 * </pre> 593 * 594 * <code>optional int32 calculated = 472082878;</code> 595 * 596 * @return The calculated. 597 */ 598 @java.lang.Override getCalculated()599 public int getCalculated() { 600 return calculated_; 601 } 602 /** 603 * 604 * 605 * <pre> 606 * [Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded. 607 * </pre> 608 * 609 * <code>optional int32 calculated = 472082878;</code> 610 * 611 * @param value The calculated to set. 612 * @return This builder for chaining. 613 */ setCalculated(int value)614 public Builder setCalculated(int value) { 615 616 calculated_ = value; 617 bitField0_ |= 0x00000001; 618 onChanged(); 619 return this; 620 } 621 /** 622 * 623 * 624 * <pre> 625 * [Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded. 626 * </pre> 627 * 628 * <code>optional int32 calculated = 472082878;</code> 629 * 630 * @return This builder for chaining. 631 */ clearCalculated()632 public Builder clearCalculated() { 633 bitField0_ = (bitField0_ & ~0x00000001); 634 calculated_ = 0; 635 onChanged(); 636 return this; 637 } 638 639 private int fixed_; 640 /** 641 * 642 * 643 * <pre> 644 * Specifies a fixed number of VM instances. This must be a positive integer. 645 * </pre> 646 * 647 * <code>optional int32 fixed = 97445748;</code> 648 * 649 * @return Whether the fixed field is set. 650 */ 651 @java.lang.Override hasFixed()652 public boolean hasFixed() { 653 return ((bitField0_ & 0x00000002) != 0); 654 } 655 /** 656 * 657 * 658 * <pre> 659 * Specifies a fixed number of VM instances. This must be a positive integer. 660 * </pre> 661 * 662 * <code>optional int32 fixed = 97445748;</code> 663 * 664 * @return The fixed. 665 */ 666 @java.lang.Override getFixed()667 public int getFixed() { 668 return fixed_; 669 } 670 /** 671 * 672 * 673 * <pre> 674 * Specifies a fixed number of VM instances. This must be a positive integer. 675 * </pre> 676 * 677 * <code>optional int32 fixed = 97445748;</code> 678 * 679 * @param value The fixed to set. 680 * @return This builder for chaining. 681 */ setFixed(int value)682 public Builder setFixed(int value) { 683 684 fixed_ = value; 685 bitField0_ |= 0x00000002; 686 onChanged(); 687 return this; 688 } 689 /** 690 * 691 * 692 * <pre> 693 * Specifies a fixed number of VM instances. This must be a positive integer. 694 * </pre> 695 * 696 * <code>optional int32 fixed = 97445748;</code> 697 * 698 * @return This builder for chaining. 699 */ clearFixed()700 public Builder clearFixed() { 701 bitField0_ = (bitField0_ & ~0x00000002); 702 fixed_ = 0; 703 onChanged(); 704 return this; 705 } 706 707 private int percent_; 708 /** 709 * 710 * 711 * <pre> 712 * Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. 713 * </pre> 714 * 715 * <code>optional int32 percent = 394814533;</code> 716 * 717 * @return Whether the percent field is set. 718 */ 719 @java.lang.Override hasPercent()720 public boolean hasPercent() { 721 return ((bitField0_ & 0x00000004) != 0); 722 } 723 /** 724 * 725 * 726 * <pre> 727 * Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. 728 * </pre> 729 * 730 * <code>optional int32 percent = 394814533;</code> 731 * 732 * @return The percent. 733 */ 734 @java.lang.Override getPercent()735 public int getPercent() { 736 return percent_; 737 } 738 /** 739 * 740 * 741 * <pre> 742 * Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. 743 * </pre> 744 * 745 * <code>optional int32 percent = 394814533;</code> 746 * 747 * @param value The percent to set. 748 * @return This builder for chaining. 749 */ setPercent(int value)750 public Builder setPercent(int value) { 751 752 percent_ = value; 753 bitField0_ |= 0x00000004; 754 onChanged(); 755 return this; 756 } 757 /** 758 * 759 * 760 * <pre> 761 * Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. 762 * </pre> 763 * 764 * <code>optional int32 percent = 394814533;</code> 765 * 766 * @return This builder for chaining. 767 */ clearPercent()768 public Builder clearPercent() { 769 bitField0_ = (bitField0_ & ~0x00000004); 770 percent_ = 0; 771 onChanged(); 772 return this; 773 } 774 775 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)776 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 777 return super.setUnknownFields(unknownFields); 778 } 779 780 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)781 public final Builder mergeUnknownFields( 782 final com.google.protobuf.UnknownFieldSet unknownFields) { 783 return super.mergeUnknownFields(unknownFields); 784 } 785 786 // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.FixedOrPercent) 787 } 788 789 // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.FixedOrPercent) 790 private static final com.google.cloud.compute.v1.FixedOrPercent DEFAULT_INSTANCE; 791 792 static { 793 DEFAULT_INSTANCE = new com.google.cloud.compute.v1.FixedOrPercent(); 794 } 795 getDefaultInstance()796 public static com.google.cloud.compute.v1.FixedOrPercent getDefaultInstance() { 797 return DEFAULT_INSTANCE; 798 } 799 800 private static final com.google.protobuf.Parser<FixedOrPercent> PARSER = 801 new com.google.protobuf.AbstractParser<FixedOrPercent>() { 802 @java.lang.Override 803 public FixedOrPercent parsePartialFrom( 804 com.google.protobuf.CodedInputStream input, 805 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 806 throws com.google.protobuf.InvalidProtocolBufferException { 807 Builder builder = newBuilder(); 808 try { 809 builder.mergeFrom(input, extensionRegistry); 810 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 811 throw e.setUnfinishedMessage(builder.buildPartial()); 812 } catch (com.google.protobuf.UninitializedMessageException e) { 813 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 814 } catch (java.io.IOException e) { 815 throw new com.google.protobuf.InvalidProtocolBufferException(e) 816 .setUnfinishedMessage(builder.buildPartial()); 817 } 818 return builder.buildPartial(); 819 } 820 }; 821 parser()822 public static com.google.protobuf.Parser<FixedOrPercent> parser() { 823 return PARSER; 824 } 825 826 @java.lang.Override getParserForType()827 public com.google.protobuf.Parser<FixedOrPercent> getParserForType() { 828 return PARSER; 829 } 830 831 @java.lang.Override getDefaultInstanceForType()832 public com.google.cloud.compute.v1.FixedOrPercent getDefaultInstanceForType() { 833 return DEFAULT_INSTANCE; 834 } 835 } 836