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