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 * </pre> 26 * 27 * Protobuf type {@code google.cloud.compute.v1.GlobalSetLabelsRequest} 28 */ 29 public final class GlobalSetLabelsRequest extends com.google.protobuf.GeneratedMessageV3 30 implements 31 // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.GlobalSetLabelsRequest) 32 GlobalSetLabelsRequestOrBuilder { 33 private static final long serialVersionUID = 0L; 34 // Use GlobalSetLabelsRequest.newBuilder() to construct. GlobalSetLabelsRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)35 private GlobalSetLabelsRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 36 super(builder); 37 } 38 GlobalSetLabelsRequest()39 private GlobalSetLabelsRequest() { 40 labelFingerprint_ = ""; 41 } 42 43 @java.lang.Override 44 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)45 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 46 return new GlobalSetLabelsRequest(); 47 } 48 49 @java.lang.Override getUnknownFields()50 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 51 return this.unknownFields; 52 } 53 getDescriptor()54 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 55 return com.google.cloud.compute.v1.Compute 56 .internal_static_google_cloud_compute_v1_GlobalSetLabelsRequest_descriptor; 57 } 58 59 @SuppressWarnings({"rawtypes"}) 60 @java.lang.Override internalGetMapField(int number)61 protected com.google.protobuf.MapField internalGetMapField(int number) { 62 switch (number) { 63 case 500195327: 64 return internalGetLabels(); 65 default: 66 throw new RuntimeException("Invalid map field number: " + number); 67 } 68 } 69 70 @java.lang.Override 71 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()72 internalGetFieldAccessorTable() { 73 return com.google.cloud.compute.v1.Compute 74 .internal_static_google_cloud_compute_v1_GlobalSetLabelsRequest_fieldAccessorTable 75 .ensureFieldAccessorsInitialized( 76 com.google.cloud.compute.v1.GlobalSetLabelsRequest.class, 77 com.google.cloud.compute.v1.GlobalSetLabelsRequest.Builder.class); 78 } 79 80 private int bitField0_; 81 public static final int LABEL_FINGERPRINT_FIELD_NUMBER = 178124825; 82 83 @SuppressWarnings("serial") 84 private volatile java.lang.Object labelFingerprint_ = ""; 85 /** 86 * 87 * 88 * <pre> 89 * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint. 90 * </pre> 91 * 92 * <code>optional string label_fingerprint = 178124825;</code> 93 * 94 * @return Whether the labelFingerprint field is set. 95 */ 96 @java.lang.Override hasLabelFingerprint()97 public boolean hasLabelFingerprint() { 98 return ((bitField0_ & 0x00000001) != 0); 99 } 100 /** 101 * 102 * 103 * <pre> 104 * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint. 105 * </pre> 106 * 107 * <code>optional string label_fingerprint = 178124825;</code> 108 * 109 * @return The labelFingerprint. 110 */ 111 @java.lang.Override getLabelFingerprint()112 public java.lang.String getLabelFingerprint() { 113 java.lang.Object ref = labelFingerprint_; 114 if (ref instanceof java.lang.String) { 115 return (java.lang.String) ref; 116 } else { 117 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 118 java.lang.String s = bs.toStringUtf8(); 119 labelFingerprint_ = s; 120 return s; 121 } 122 } 123 /** 124 * 125 * 126 * <pre> 127 * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint. 128 * </pre> 129 * 130 * <code>optional string label_fingerprint = 178124825;</code> 131 * 132 * @return The bytes for labelFingerprint. 133 */ 134 @java.lang.Override getLabelFingerprintBytes()135 public com.google.protobuf.ByteString getLabelFingerprintBytes() { 136 java.lang.Object ref = labelFingerprint_; 137 if (ref instanceof java.lang.String) { 138 com.google.protobuf.ByteString b = 139 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 140 labelFingerprint_ = b; 141 return b; 142 } else { 143 return (com.google.protobuf.ByteString) ref; 144 } 145 } 146 147 public static final int LABELS_FIELD_NUMBER = 500195327; 148 149 private static final class LabelsDefaultEntryHolder { 150 static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry = 151 com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance( 152 com.google.cloud.compute.v1.Compute 153 .internal_static_google_cloud_compute_v1_GlobalSetLabelsRequest_LabelsEntry_descriptor, 154 com.google.protobuf.WireFormat.FieldType.STRING, 155 "", 156 com.google.protobuf.WireFormat.FieldType.STRING, 157 ""); 158 } 159 160 @SuppressWarnings("serial") 161 private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_; 162 internalGetLabels()163 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() { 164 if (labels_ == null) { 165 return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); 166 } 167 return labels_; 168 } 169 getLabelsCount()170 public int getLabelsCount() { 171 return internalGetLabels().getMap().size(); 172 } 173 /** 174 * 175 * 176 * <pre> 177 * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). 178 * </pre> 179 * 180 * <code>map<string, string> labels = 500195327;</code> 181 */ 182 @java.lang.Override containsLabels(java.lang.String key)183 public boolean containsLabels(java.lang.String key) { 184 if (key == null) { 185 throw new NullPointerException("map key"); 186 } 187 return internalGetLabels().getMap().containsKey(key); 188 } 189 /** Use {@link #getLabelsMap()} instead. */ 190 @java.lang.Override 191 @java.lang.Deprecated getLabels()192 public java.util.Map<java.lang.String, java.lang.String> getLabels() { 193 return getLabelsMap(); 194 } 195 /** 196 * 197 * 198 * <pre> 199 * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). 200 * </pre> 201 * 202 * <code>map<string, string> labels = 500195327;</code> 203 */ 204 @java.lang.Override getLabelsMap()205 public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() { 206 return internalGetLabels().getMap(); 207 } 208 /** 209 * 210 * 211 * <pre> 212 * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). 213 * </pre> 214 * 215 * <code>map<string, string> labels = 500195327;</code> 216 */ 217 @java.lang.Override getLabelsOrDefault( java.lang.String key, java.lang.String defaultValue)218 public /* nullable */ java.lang.String getLabelsOrDefault( 219 java.lang.String key, 220 /* nullable */ 221 java.lang.String defaultValue) { 222 if (key == null) { 223 throw new NullPointerException("map key"); 224 } 225 java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); 226 return map.containsKey(key) ? map.get(key) : defaultValue; 227 } 228 /** 229 * 230 * 231 * <pre> 232 * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). 233 * </pre> 234 * 235 * <code>map<string, string> labels = 500195327;</code> 236 */ 237 @java.lang.Override getLabelsOrThrow(java.lang.String key)238 public java.lang.String getLabelsOrThrow(java.lang.String key) { 239 if (key == null) { 240 throw new NullPointerException("map key"); 241 } 242 java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); 243 if (!map.containsKey(key)) { 244 throw new java.lang.IllegalArgumentException(); 245 } 246 return map.get(key); 247 } 248 249 private byte memoizedIsInitialized = -1; 250 251 @java.lang.Override isInitialized()252 public final boolean isInitialized() { 253 byte isInitialized = memoizedIsInitialized; 254 if (isInitialized == 1) return true; 255 if (isInitialized == 0) return false; 256 257 memoizedIsInitialized = 1; 258 return true; 259 } 260 261 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)262 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 263 if (((bitField0_ & 0x00000001) != 0)) { 264 com.google.protobuf.GeneratedMessageV3.writeString(output, 178124825, labelFingerprint_); 265 } 266 com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( 267 output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 500195327); 268 getUnknownFields().writeTo(output); 269 } 270 271 @java.lang.Override getSerializedSize()272 public int getSerializedSize() { 273 int size = memoizedSize; 274 if (size != -1) return size; 275 276 size = 0; 277 if (((bitField0_ & 0x00000001) != 0)) { 278 size += 279 com.google.protobuf.GeneratedMessageV3.computeStringSize(178124825, labelFingerprint_); 280 } 281 for (java.util.Map.Entry<java.lang.String, java.lang.String> entry : 282 internalGetLabels().getMap().entrySet()) { 283 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ = 284 LabelsDefaultEntryHolder.defaultEntry 285 .newBuilderForType() 286 .setKey(entry.getKey()) 287 .setValue(entry.getValue()) 288 .build(); 289 size += com.google.protobuf.CodedOutputStream.computeMessageSize(500195327, labels__); 290 } 291 size += getUnknownFields().getSerializedSize(); 292 memoizedSize = size; 293 return size; 294 } 295 296 @java.lang.Override equals(final java.lang.Object obj)297 public boolean equals(final java.lang.Object obj) { 298 if (obj == this) { 299 return true; 300 } 301 if (!(obj instanceof com.google.cloud.compute.v1.GlobalSetLabelsRequest)) { 302 return super.equals(obj); 303 } 304 com.google.cloud.compute.v1.GlobalSetLabelsRequest other = 305 (com.google.cloud.compute.v1.GlobalSetLabelsRequest) obj; 306 307 if (hasLabelFingerprint() != other.hasLabelFingerprint()) return false; 308 if (hasLabelFingerprint()) { 309 if (!getLabelFingerprint().equals(other.getLabelFingerprint())) return false; 310 } 311 if (!internalGetLabels().equals(other.internalGetLabels())) return false; 312 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 313 return true; 314 } 315 316 @java.lang.Override hashCode()317 public int hashCode() { 318 if (memoizedHashCode != 0) { 319 return memoizedHashCode; 320 } 321 int hash = 41; 322 hash = (19 * hash) + getDescriptor().hashCode(); 323 if (hasLabelFingerprint()) { 324 hash = (37 * hash) + LABEL_FINGERPRINT_FIELD_NUMBER; 325 hash = (53 * hash) + getLabelFingerprint().hashCode(); 326 } 327 if (!internalGetLabels().getMap().isEmpty()) { 328 hash = (37 * hash) + LABELS_FIELD_NUMBER; 329 hash = (53 * hash) + internalGetLabels().hashCode(); 330 } 331 hash = (29 * hash) + getUnknownFields().hashCode(); 332 memoizedHashCode = hash; 333 return hash; 334 } 335 parseFrom( java.nio.ByteBuffer data)336 public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom( 337 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 338 return PARSER.parseFrom(data); 339 } 340 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)341 public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom( 342 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 343 throws com.google.protobuf.InvalidProtocolBufferException { 344 return PARSER.parseFrom(data, extensionRegistry); 345 } 346 parseFrom( com.google.protobuf.ByteString data)347 public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom( 348 com.google.protobuf.ByteString data) 349 throws com.google.protobuf.InvalidProtocolBufferException { 350 return PARSER.parseFrom(data); 351 } 352 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)353 public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom( 354 com.google.protobuf.ByteString data, 355 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 356 throws com.google.protobuf.InvalidProtocolBufferException { 357 return PARSER.parseFrom(data, extensionRegistry); 358 } 359 parseFrom(byte[] data)360 public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom(byte[] data) 361 throws com.google.protobuf.InvalidProtocolBufferException { 362 return PARSER.parseFrom(data); 363 } 364 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)365 public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom( 366 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 367 throws com.google.protobuf.InvalidProtocolBufferException { 368 return PARSER.parseFrom(data, extensionRegistry); 369 } 370 parseFrom( java.io.InputStream input)371 public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom( 372 java.io.InputStream input) throws java.io.IOException { 373 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 374 } 375 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)376 public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom( 377 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 378 throws java.io.IOException { 379 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 380 PARSER, input, extensionRegistry); 381 } 382 parseDelimitedFrom( java.io.InputStream input)383 public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseDelimitedFrom( 384 java.io.InputStream input) throws java.io.IOException { 385 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 386 } 387 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)388 public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseDelimitedFrom( 389 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 390 throws java.io.IOException { 391 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 392 PARSER, input, extensionRegistry); 393 } 394 parseFrom( com.google.protobuf.CodedInputStream input)395 public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom( 396 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 397 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 398 } 399 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)400 public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom( 401 com.google.protobuf.CodedInputStream input, 402 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 403 throws java.io.IOException { 404 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 405 PARSER, input, extensionRegistry); 406 } 407 408 @java.lang.Override newBuilderForType()409 public Builder newBuilderForType() { 410 return newBuilder(); 411 } 412 newBuilder()413 public static Builder newBuilder() { 414 return DEFAULT_INSTANCE.toBuilder(); 415 } 416 newBuilder(com.google.cloud.compute.v1.GlobalSetLabelsRequest prototype)417 public static Builder newBuilder(com.google.cloud.compute.v1.GlobalSetLabelsRequest prototype) { 418 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 419 } 420 421 @java.lang.Override toBuilder()422 public Builder toBuilder() { 423 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 424 } 425 426 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)427 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 428 Builder builder = new Builder(parent); 429 return builder; 430 } 431 /** 432 * 433 * 434 * <pre> 435 * </pre> 436 * 437 * Protobuf type {@code google.cloud.compute.v1.GlobalSetLabelsRequest} 438 */ 439 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 440 implements 441 // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.GlobalSetLabelsRequest) 442 com.google.cloud.compute.v1.GlobalSetLabelsRequestOrBuilder { getDescriptor()443 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 444 return com.google.cloud.compute.v1.Compute 445 .internal_static_google_cloud_compute_v1_GlobalSetLabelsRequest_descriptor; 446 } 447 448 @SuppressWarnings({"rawtypes"}) internalGetMapField(int number)449 protected com.google.protobuf.MapField internalGetMapField(int number) { 450 switch (number) { 451 case 500195327: 452 return internalGetLabels(); 453 default: 454 throw new RuntimeException("Invalid map field number: " + number); 455 } 456 } 457 458 @SuppressWarnings({"rawtypes"}) internalGetMutableMapField(int number)459 protected com.google.protobuf.MapField internalGetMutableMapField(int number) { 460 switch (number) { 461 case 500195327: 462 return internalGetMutableLabels(); 463 default: 464 throw new RuntimeException("Invalid map field number: " + number); 465 } 466 } 467 468 @java.lang.Override 469 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()470 internalGetFieldAccessorTable() { 471 return com.google.cloud.compute.v1.Compute 472 .internal_static_google_cloud_compute_v1_GlobalSetLabelsRequest_fieldAccessorTable 473 .ensureFieldAccessorsInitialized( 474 com.google.cloud.compute.v1.GlobalSetLabelsRequest.class, 475 com.google.cloud.compute.v1.GlobalSetLabelsRequest.Builder.class); 476 } 477 478 // Construct using com.google.cloud.compute.v1.GlobalSetLabelsRequest.newBuilder() Builder()479 private Builder() {} 480 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)481 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 482 super(parent); 483 } 484 485 @java.lang.Override clear()486 public Builder clear() { 487 super.clear(); 488 bitField0_ = 0; 489 labelFingerprint_ = ""; 490 internalGetMutableLabels().clear(); 491 return this; 492 } 493 494 @java.lang.Override getDescriptorForType()495 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 496 return com.google.cloud.compute.v1.Compute 497 .internal_static_google_cloud_compute_v1_GlobalSetLabelsRequest_descriptor; 498 } 499 500 @java.lang.Override getDefaultInstanceForType()501 public com.google.cloud.compute.v1.GlobalSetLabelsRequest getDefaultInstanceForType() { 502 return com.google.cloud.compute.v1.GlobalSetLabelsRequest.getDefaultInstance(); 503 } 504 505 @java.lang.Override build()506 public com.google.cloud.compute.v1.GlobalSetLabelsRequest build() { 507 com.google.cloud.compute.v1.GlobalSetLabelsRequest result = buildPartial(); 508 if (!result.isInitialized()) { 509 throw newUninitializedMessageException(result); 510 } 511 return result; 512 } 513 514 @java.lang.Override buildPartial()515 public com.google.cloud.compute.v1.GlobalSetLabelsRequest buildPartial() { 516 com.google.cloud.compute.v1.GlobalSetLabelsRequest result = 517 new com.google.cloud.compute.v1.GlobalSetLabelsRequest(this); 518 if (bitField0_ != 0) { 519 buildPartial0(result); 520 } 521 onBuilt(); 522 return result; 523 } 524 buildPartial0(com.google.cloud.compute.v1.GlobalSetLabelsRequest result)525 private void buildPartial0(com.google.cloud.compute.v1.GlobalSetLabelsRequest result) { 526 int from_bitField0_ = bitField0_; 527 int to_bitField0_ = 0; 528 if (((from_bitField0_ & 0x00000001) != 0)) { 529 result.labelFingerprint_ = labelFingerprint_; 530 to_bitField0_ |= 0x00000001; 531 } 532 if (((from_bitField0_ & 0x00000002) != 0)) { 533 result.labels_ = internalGetLabels(); 534 result.labels_.makeImmutable(); 535 } 536 result.bitField0_ |= to_bitField0_; 537 } 538 539 @java.lang.Override clone()540 public Builder clone() { 541 return super.clone(); 542 } 543 544 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)545 public Builder setField( 546 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 547 return super.setField(field, value); 548 } 549 550 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)551 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 552 return super.clearField(field); 553 } 554 555 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)556 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 557 return super.clearOneof(oneof); 558 } 559 560 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)561 public Builder setRepeatedField( 562 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 563 return super.setRepeatedField(field, index, value); 564 } 565 566 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)567 public Builder addRepeatedField( 568 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 569 return super.addRepeatedField(field, value); 570 } 571 572 @java.lang.Override mergeFrom(com.google.protobuf.Message other)573 public Builder mergeFrom(com.google.protobuf.Message other) { 574 if (other instanceof com.google.cloud.compute.v1.GlobalSetLabelsRequest) { 575 return mergeFrom((com.google.cloud.compute.v1.GlobalSetLabelsRequest) other); 576 } else { 577 super.mergeFrom(other); 578 return this; 579 } 580 } 581 mergeFrom(com.google.cloud.compute.v1.GlobalSetLabelsRequest other)582 public Builder mergeFrom(com.google.cloud.compute.v1.GlobalSetLabelsRequest other) { 583 if (other == com.google.cloud.compute.v1.GlobalSetLabelsRequest.getDefaultInstance()) 584 return this; 585 if (other.hasLabelFingerprint()) { 586 labelFingerprint_ = other.labelFingerprint_; 587 bitField0_ |= 0x00000001; 588 onChanged(); 589 } 590 internalGetMutableLabels().mergeFrom(other.internalGetLabels()); 591 bitField0_ |= 0x00000002; 592 this.mergeUnknownFields(other.getUnknownFields()); 593 onChanged(); 594 return this; 595 } 596 597 @java.lang.Override isInitialized()598 public final boolean isInitialized() { 599 return true; 600 } 601 602 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)603 public Builder mergeFrom( 604 com.google.protobuf.CodedInputStream input, 605 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 606 throws java.io.IOException { 607 if (extensionRegistry == null) { 608 throw new java.lang.NullPointerException(); 609 } 610 try { 611 boolean done = false; 612 while (!done) { 613 int tag = input.readTag(); 614 switch (tag) { 615 case 0: 616 done = true; 617 break; 618 case 1424998602: 619 { 620 labelFingerprint_ = input.readStringRequireUtf8(); 621 bitField0_ |= 0x00000001; 622 break; 623 } // case 1424998602 624 case -293404678: 625 { 626 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ = 627 input.readMessage( 628 LabelsDefaultEntryHolder.defaultEntry.getParserForType(), 629 extensionRegistry); 630 internalGetMutableLabels() 631 .getMutableMap() 632 .put(labels__.getKey(), labels__.getValue()); 633 bitField0_ |= 0x00000002; 634 break; 635 } // case -293404678 636 default: 637 { 638 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 639 done = true; // was an endgroup tag 640 } 641 break; 642 } // default: 643 } // switch (tag) 644 } // while (!done) 645 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 646 throw e.unwrapIOException(); 647 } finally { 648 onChanged(); 649 } // finally 650 return this; 651 } 652 653 private int bitField0_; 654 655 private java.lang.Object labelFingerprint_ = ""; 656 /** 657 * 658 * 659 * <pre> 660 * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint. 661 * </pre> 662 * 663 * <code>optional string label_fingerprint = 178124825;</code> 664 * 665 * @return Whether the labelFingerprint field is set. 666 */ hasLabelFingerprint()667 public boolean hasLabelFingerprint() { 668 return ((bitField0_ & 0x00000001) != 0); 669 } 670 /** 671 * 672 * 673 * <pre> 674 * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint. 675 * </pre> 676 * 677 * <code>optional string label_fingerprint = 178124825;</code> 678 * 679 * @return The labelFingerprint. 680 */ getLabelFingerprint()681 public java.lang.String getLabelFingerprint() { 682 java.lang.Object ref = labelFingerprint_; 683 if (!(ref instanceof java.lang.String)) { 684 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 685 java.lang.String s = bs.toStringUtf8(); 686 labelFingerprint_ = s; 687 return s; 688 } else { 689 return (java.lang.String) ref; 690 } 691 } 692 /** 693 * 694 * 695 * <pre> 696 * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint. 697 * </pre> 698 * 699 * <code>optional string label_fingerprint = 178124825;</code> 700 * 701 * @return The bytes for labelFingerprint. 702 */ getLabelFingerprintBytes()703 public com.google.protobuf.ByteString getLabelFingerprintBytes() { 704 java.lang.Object ref = labelFingerprint_; 705 if (ref instanceof String) { 706 com.google.protobuf.ByteString b = 707 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 708 labelFingerprint_ = b; 709 return b; 710 } else { 711 return (com.google.protobuf.ByteString) ref; 712 } 713 } 714 /** 715 * 716 * 717 * <pre> 718 * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint. 719 * </pre> 720 * 721 * <code>optional string label_fingerprint = 178124825;</code> 722 * 723 * @param value The labelFingerprint to set. 724 * @return This builder for chaining. 725 */ setLabelFingerprint(java.lang.String value)726 public Builder setLabelFingerprint(java.lang.String value) { 727 if (value == null) { 728 throw new NullPointerException(); 729 } 730 labelFingerprint_ = value; 731 bitField0_ |= 0x00000001; 732 onChanged(); 733 return this; 734 } 735 /** 736 * 737 * 738 * <pre> 739 * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint. 740 * </pre> 741 * 742 * <code>optional string label_fingerprint = 178124825;</code> 743 * 744 * @return This builder for chaining. 745 */ clearLabelFingerprint()746 public Builder clearLabelFingerprint() { 747 labelFingerprint_ = getDefaultInstance().getLabelFingerprint(); 748 bitField0_ = (bitField0_ & ~0x00000001); 749 onChanged(); 750 return this; 751 } 752 /** 753 * 754 * 755 * <pre> 756 * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint. 757 * </pre> 758 * 759 * <code>optional string label_fingerprint = 178124825;</code> 760 * 761 * @param value The bytes for labelFingerprint to set. 762 * @return This builder for chaining. 763 */ setLabelFingerprintBytes(com.google.protobuf.ByteString value)764 public Builder setLabelFingerprintBytes(com.google.protobuf.ByteString value) { 765 if (value == null) { 766 throw new NullPointerException(); 767 } 768 checkByteStringIsUtf8(value); 769 labelFingerprint_ = value; 770 bitField0_ |= 0x00000001; 771 onChanged(); 772 return this; 773 } 774 775 private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_; 776 internalGetLabels()777 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() { 778 if (labels_ == null) { 779 return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); 780 } 781 return labels_; 782 } 783 784 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMutableLabels()785 internalGetMutableLabels() { 786 if (labels_ == null) { 787 labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); 788 } 789 if (!labels_.isMutable()) { 790 labels_ = labels_.copy(); 791 } 792 bitField0_ |= 0x00000002; 793 onChanged(); 794 return labels_; 795 } 796 getLabelsCount()797 public int getLabelsCount() { 798 return internalGetLabels().getMap().size(); 799 } 800 /** 801 * 802 * 803 * <pre> 804 * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). 805 * </pre> 806 * 807 * <code>map<string, string> labels = 500195327;</code> 808 */ 809 @java.lang.Override containsLabels(java.lang.String key)810 public boolean containsLabels(java.lang.String key) { 811 if (key == null) { 812 throw new NullPointerException("map key"); 813 } 814 return internalGetLabels().getMap().containsKey(key); 815 } 816 /** Use {@link #getLabelsMap()} instead. */ 817 @java.lang.Override 818 @java.lang.Deprecated getLabels()819 public java.util.Map<java.lang.String, java.lang.String> getLabels() { 820 return getLabelsMap(); 821 } 822 /** 823 * 824 * 825 * <pre> 826 * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). 827 * </pre> 828 * 829 * <code>map<string, string> labels = 500195327;</code> 830 */ 831 @java.lang.Override getLabelsMap()832 public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() { 833 return internalGetLabels().getMap(); 834 } 835 /** 836 * 837 * 838 * <pre> 839 * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). 840 * </pre> 841 * 842 * <code>map<string, string> labels = 500195327;</code> 843 */ 844 @java.lang.Override getLabelsOrDefault( java.lang.String key, java.lang.String defaultValue)845 public /* nullable */ java.lang.String getLabelsOrDefault( 846 java.lang.String key, 847 /* nullable */ 848 java.lang.String defaultValue) { 849 if (key == null) { 850 throw new NullPointerException("map key"); 851 } 852 java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); 853 return map.containsKey(key) ? map.get(key) : defaultValue; 854 } 855 /** 856 * 857 * 858 * <pre> 859 * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). 860 * </pre> 861 * 862 * <code>map<string, string> labels = 500195327;</code> 863 */ 864 @java.lang.Override getLabelsOrThrow(java.lang.String key)865 public java.lang.String getLabelsOrThrow(java.lang.String key) { 866 if (key == null) { 867 throw new NullPointerException("map key"); 868 } 869 java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); 870 if (!map.containsKey(key)) { 871 throw new java.lang.IllegalArgumentException(); 872 } 873 return map.get(key); 874 } 875 clearLabels()876 public Builder clearLabels() { 877 bitField0_ = (bitField0_ & ~0x00000002); 878 internalGetMutableLabels().getMutableMap().clear(); 879 return this; 880 } 881 /** 882 * 883 * 884 * <pre> 885 * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). 886 * </pre> 887 * 888 * <code>map<string, string> labels = 500195327;</code> 889 */ removeLabels(java.lang.String key)890 public Builder removeLabels(java.lang.String key) { 891 if (key == null) { 892 throw new NullPointerException("map key"); 893 } 894 internalGetMutableLabels().getMutableMap().remove(key); 895 return this; 896 } 897 /** Use alternate mutation accessors instead. */ 898 @java.lang.Deprecated getMutableLabels()899 public java.util.Map<java.lang.String, java.lang.String> getMutableLabels() { 900 bitField0_ |= 0x00000002; 901 return internalGetMutableLabels().getMutableMap(); 902 } 903 /** 904 * 905 * 906 * <pre> 907 * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). 908 * </pre> 909 * 910 * <code>map<string, string> labels = 500195327;</code> 911 */ putLabels(java.lang.String key, java.lang.String value)912 public Builder putLabels(java.lang.String key, java.lang.String value) { 913 if (key == null) { 914 throw new NullPointerException("map key"); 915 } 916 if (value == null) { 917 throw new NullPointerException("map value"); 918 } 919 internalGetMutableLabels().getMutableMap().put(key, value); 920 bitField0_ |= 0x00000002; 921 return this; 922 } 923 /** 924 * 925 * 926 * <pre> 927 * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). 928 * </pre> 929 * 930 * <code>map<string, string> labels = 500195327;</code> 931 */ putAllLabels(java.util.Map<java.lang.String, java.lang.String> values)932 public Builder putAllLabels(java.util.Map<java.lang.String, java.lang.String> values) { 933 internalGetMutableLabels().getMutableMap().putAll(values); 934 bitField0_ |= 0x00000002; 935 return this; 936 } 937 938 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)939 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 940 return super.setUnknownFields(unknownFields); 941 } 942 943 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)944 public final Builder mergeUnknownFields( 945 final com.google.protobuf.UnknownFieldSet unknownFields) { 946 return super.mergeUnknownFields(unknownFields); 947 } 948 949 // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.GlobalSetLabelsRequest) 950 } 951 952 // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.GlobalSetLabelsRequest) 953 private static final com.google.cloud.compute.v1.GlobalSetLabelsRequest DEFAULT_INSTANCE; 954 955 static { 956 DEFAULT_INSTANCE = new com.google.cloud.compute.v1.GlobalSetLabelsRequest(); 957 } 958 getDefaultInstance()959 public static com.google.cloud.compute.v1.GlobalSetLabelsRequest getDefaultInstance() { 960 return DEFAULT_INSTANCE; 961 } 962 963 private static final com.google.protobuf.Parser<GlobalSetLabelsRequest> PARSER = 964 new com.google.protobuf.AbstractParser<GlobalSetLabelsRequest>() { 965 @java.lang.Override 966 public GlobalSetLabelsRequest parsePartialFrom( 967 com.google.protobuf.CodedInputStream input, 968 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 969 throws com.google.protobuf.InvalidProtocolBufferException { 970 Builder builder = newBuilder(); 971 try { 972 builder.mergeFrom(input, extensionRegistry); 973 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 974 throw e.setUnfinishedMessage(builder.buildPartial()); 975 } catch (com.google.protobuf.UninitializedMessageException e) { 976 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 977 } catch (java.io.IOException e) { 978 throw new com.google.protobuf.InvalidProtocolBufferException(e) 979 .setUnfinishedMessage(builder.buildPartial()); 980 } 981 return builder.buildPartial(); 982 } 983 }; 984 parser()985 public static com.google.protobuf.Parser<GlobalSetLabelsRequest> parser() { 986 return PARSER; 987 } 988 989 @java.lang.Override getParserForType()990 public com.google.protobuf.Parser<GlobalSetLabelsRequest> getParserForType() { 991 return PARSER; 992 } 993 994 @java.lang.Override getDefaultInstanceForType()995 public com.google.cloud.compute.v1.GlobalSetLabelsRequest getDefaultInstanceForType() { 996 return DEFAULT_INSTANCE; 997 } 998 } 999