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