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