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/orgpolicy/v2/constraint.proto 18 19 package com.google.cloud.orgpolicy.v2; 20 21 /** 22 * 23 * 24 * <pre> 25 * A `constraint` describes a way to restrict resource's configuration. For 26 * example, you could enforce a constraint that controls which cloud services 27 * can be activated across an organization, or whether a Compute Engine instance 28 * can have serial port connections established. `Constraints` can be configured 29 * by the organization's policy administrator to fit the needs of the 30 * organization by setting a `policy` that includes `constraints` at different 31 * locations in the organization's resource hierarchy. Policies are inherited 32 * down the resource hierarchy from higher levels, but can also be overridden. 33 * For details about the inheritance rules please read about 34 * [`policies`][google.cloud.OrgPolicy.v2.Policy]. 35 * `Constraints` have a default behavior determined by the `constraint_default` 36 * field, which is the enforcement behavior that is used in the absence of a 37 * `policy` being defined or inherited for the resource in question. 38 * </pre> 39 * 40 * Protobuf type {@code google.cloud.orgpolicy.v2.Constraint} 41 */ 42 public final class Constraint extends com.google.protobuf.GeneratedMessageV3 43 implements 44 // @@protoc_insertion_point(message_implements:google.cloud.orgpolicy.v2.Constraint) 45 ConstraintOrBuilder { 46 private static final long serialVersionUID = 0L; 47 // Use Constraint.newBuilder() to construct. Constraint(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)48 private Constraint(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 49 super(builder); 50 } 51 Constraint()52 private Constraint() { 53 name_ = ""; 54 displayName_ = ""; 55 description_ = ""; 56 constraintDefault_ = 0; 57 } 58 59 @java.lang.Override 60 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)61 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 62 return new Constraint(); 63 } 64 65 @java.lang.Override getUnknownFields()66 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 67 return this.unknownFields; 68 } 69 getDescriptor()70 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 71 return com.google.cloud.orgpolicy.v2.ConstraintProto 72 .internal_static_google_cloud_orgpolicy_v2_Constraint_descriptor; 73 } 74 75 @java.lang.Override 76 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()77 internalGetFieldAccessorTable() { 78 return com.google.cloud.orgpolicy.v2.ConstraintProto 79 .internal_static_google_cloud_orgpolicy_v2_Constraint_fieldAccessorTable 80 .ensureFieldAccessorsInitialized( 81 com.google.cloud.orgpolicy.v2.Constraint.class, 82 com.google.cloud.orgpolicy.v2.Constraint.Builder.class); 83 } 84 85 /** 86 * 87 * 88 * <pre> 89 * Specifies the default behavior in the absence of any `Policy` for the 90 * `Constraint`. This must not be `CONSTRAINT_DEFAULT_UNSPECIFIED`. 91 * Immutable after creation. 92 * </pre> 93 * 94 * Protobuf enum {@code google.cloud.orgpolicy.v2.Constraint.ConstraintDefault} 95 */ 96 public enum ConstraintDefault implements com.google.protobuf.ProtocolMessageEnum { 97 /** 98 * 99 * 100 * <pre> 101 * This is only used for distinguishing unset values and should never be 102 * used. 103 * </pre> 104 * 105 * <code>CONSTRAINT_DEFAULT_UNSPECIFIED = 0;</code> 106 */ 107 CONSTRAINT_DEFAULT_UNSPECIFIED(0), 108 /** 109 * 110 * 111 * <pre> 112 * Indicate that all values are allowed for list constraints. 113 * Indicate that enforcement is off for boolean constraints. 114 * </pre> 115 * 116 * <code>ALLOW = 1;</code> 117 */ 118 ALLOW(1), 119 /** 120 * 121 * 122 * <pre> 123 * Indicate that all values are denied for list constraints. 124 * Indicate that enforcement is on for boolean constraints. 125 * </pre> 126 * 127 * <code>DENY = 2;</code> 128 */ 129 DENY(2), 130 UNRECOGNIZED(-1), 131 ; 132 133 /** 134 * 135 * 136 * <pre> 137 * This is only used for distinguishing unset values and should never be 138 * used. 139 * </pre> 140 * 141 * <code>CONSTRAINT_DEFAULT_UNSPECIFIED = 0;</code> 142 */ 143 public static final int CONSTRAINT_DEFAULT_UNSPECIFIED_VALUE = 0; 144 /** 145 * 146 * 147 * <pre> 148 * Indicate that all values are allowed for list constraints. 149 * Indicate that enforcement is off for boolean constraints. 150 * </pre> 151 * 152 * <code>ALLOW = 1;</code> 153 */ 154 public static final int ALLOW_VALUE = 1; 155 /** 156 * 157 * 158 * <pre> 159 * Indicate that all values are denied for list constraints. 160 * Indicate that enforcement is on for boolean constraints. 161 * </pre> 162 * 163 * <code>DENY = 2;</code> 164 */ 165 public static final int DENY_VALUE = 2; 166 getNumber()167 public final int getNumber() { 168 if (this == UNRECOGNIZED) { 169 throw new java.lang.IllegalArgumentException( 170 "Can't get the number of an unknown enum value."); 171 } 172 return value; 173 } 174 175 /** 176 * @param value The numeric wire value of the corresponding enum entry. 177 * @return The enum associated with the given numeric wire value. 178 * @deprecated Use {@link #forNumber(int)} instead. 179 */ 180 @java.lang.Deprecated valueOf(int value)181 public static ConstraintDefault valueOf(int value) { 182 return forNumber(value); 183 } 184 185 /** 186 * @param value The numeric wire value of the corresponding enum entry. 187 * @return The enum associated with the given numeric wire value. 188 */ forNumber(int value)189 public static ConstraintDefault forNumber(int value) { 190 switch (value) { 191 case 0: 192 return CONSTRAINT_DEFAULT_UNSPECIFIED; 193 case 1: 194 return ALLOW; 195 case 2: 196 return DENY; 197 default: 198 return null; 199 } 200 } 201 202 public static com.google.protobuf.Internal.EnumLiteMap<ConstraintDefault> internalGetValueMap()203 internalGetValueMap() { 204 return internalValueMap; 205 } 206 207 private static final com.google.protobuf.Internal.EnumLiteMap<ConstraintDefault> 208 internalValueMap = 209 new com.google.protobuf.Internal.EnumLiteMap<ConstraintDefault>() { 210 public ConstraintDefault findValueByNumber(int number) { 211 return ConstraintDefault.forNumber(number); 212 } 213 }; 214 getValueDescriptor()215 public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 216 if (this == UNRECOGNIZED) { 217 throw new java.lang.IllegalStateException( 218 "Can't get the descriptor of an unrecognized enum value."); 219 } 220 return getDescriptor().getValues().get(ordinal()); 221 } 222 getDescriptorForType()223 public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { 224 return getDescriptor(); 225 } 226 getDescriptor()227 public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { 228 return com.google.cloud.orgpolicy.v2.Constraint.getDescriptor().getEnumTypes().get(0); 229 } 230 231 private static final ConstraintDefault[] VALUES = values(); 232 valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc)233 public static ConstraintDefault valueOf( 234 com.google.protobuf.Descriptors.EnumValueDescriptor desc) { 235 if (desc.getType() != getDescriptor()) { 236 throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); 237 } 238 if (desc.getIndex() == -1) { 239 return UNRECOGNIZED; 240 } 241 return VALUES[desc.getIndex()]; 242 } 243 244 private final int value; 245 ConstraintDefault(int value)246 private ConstraintDefault(int value) { 247 this.value = value; 248 } 249 250 // @@protoc_insertion_point(enum_scope:google.cloud.orgpolicy.v2.Constraint.ConstraintDefault) 251 } 252 253 public interface ListConstraintOrBuilder 254 extends 255 // @@protoc_insertion_point(interface_extends:google.cloud.orgpolicy.v2.Constraint.ListConstraint) 256 com.google.protobuf.MessageOrBuilder { 257 258 /** 259 * 260 * 261 * <pre> 262 * Indicates whether values grouped into categories can be used in 263 * `Policy.allowed_values` and `Policy.denied_values`. For example, 264 * `"in:Python"` would match any value in the 'Python' group. 265 * </pre> 266 * 267 * <code>bool supports_in = 1;</code> 268 * 269 * @return The supportsIn. 270 */ getSupportsIn()271 boolean getSupportsIn(); 272 273 /** 274 * 275 * 276 * <pre> 277 * Indicates whether subtrees of Cloud Resource Manager resource hierarchy 278 * can be used in `Policy.allowed_values` and `Policy.denied_values`. For 279 * example, `"under:folders/123"` would match any resource under the 280 * 'folders/123' folder. 281 * </pre> 282 * 283 * <code>bool supports_under = 2;</code> 284 * 285 * @return The supportsUnder. 286 */ getSupportsUnder()287 boolean getSupportsUnder(); 288 } 289 /** 290 * 291 * 292 * <pre> 293 * A `Constraint` that allows or disallows a list of string values, which are 294 * configured by an Organization's policy administrator with a `Policy`. 295 * </pre> 296 * 297 * Protobuf type {@code google.cloud.orgpolicy.v2.Constraint.ListConstraint} 298 */ 299 public static final class ListConstraint extends com.google.protobuf.GeneratedMessageV3 300 implements 301 // @@protoc_insertion_point(message_implements:google.cloud.orgpolicy.v2.Constraint.ListConstraint) 302 ListConstraintOrBuilder { 303 private static final long serialVersionUID = 0L; 304 // Use ListConstraint.newBuilder() to construct. ListConstraint(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)305 private ListConstraint(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 306 super(builder); 307 } 308 ListConstraint()309 private ListConstraint() {} 310 311 @java.lang.Override 312 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)313 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 314 return new ListConstraint(); 315 } 316 317 @java.lang.Override getUnknownFields()318 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 319 return this.unknownFields; 320 } 321 getDescriptor()322 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 323 return com.google.cloud.orgpolicy.v2.ConstraintProto 324 .internal_static_google_cloud_orgpolicy_v2_Constraint_ListConstraint_descriptor; 325 } 326 327 @java.lang.Override 328 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()329 internalGetFieldAccessorTable() { 330 return com.google.cloud.orgpolicy.v2.ConstraintProto 331 .internal_static_google_cloud_orgpolicy_v2_Constraint_ListConstraint_fieldAccessorTable 332 .ensureFieldAccessorsInitialized( 333 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.class, 334 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.Builder.class); 335 } 336 337 public static final int SUPPORTS_IN_FIELD_NUMBER = 1; 338 private boolean supportsIn_ = false; 339 /** 340 * 341 * 342 * <pre> 343 * Indicates whether values grouped into categories can be used in 344 * `Policy.allowed_values` and `Policy.denied_values`. For example, 345 * `"in:Python"` would match any value in the 'Python' group. 346 * </pre> 347 * 348 * <code>bool supports_in = 1;</code> 349 * 350 * @return The supportsIn. 351 */ 352 @java.lang.Override getSupportsIn()353 public boolean getSupportsIn() { 354 return supportsIn_; 355 } 356 357 public static final int SUPPORTS_UNDER_FIELD_NUMBER = 2; 358 private boolean supportsUnder_ = false; 359 /** 360 * 361 * 362 * <pre> 363 * Indicates whether subtrees of Cloud Resource Manager resource hierarchy 364 * can be used in `Policy.allowed_values` and `Policy.denied_values`. For 365 * example, `"under:folders/123"` would match any resource under the 366 * 'folders/123' folder. 367 * </pre> 368 * 369 * <code>bool supports_under = 2;</code> 370 * 371 * @return The supportsUnder. 372 */ 373 @java.lang.Override getSupportsUnder()374 public boolean getSupportsUnder() { 375 return supportsUnder_; 376 } 377 378 private byte memoizedIsInitialized = -1; 379 380 @java.lang.Override isInitialized()381 public final boolean isInitialized() { 382 byte isInitialized = memoizedIsInitialized; 383 if (isInitialized == 1) return true; 384 if (isInitialized == 0) return false; 385 386 memoizedIsInitialized = 1; 387 return true; 388 } 389 390 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)391 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 392 if (supportsIn_ != false) { 393 output.writeBool(1, supportsIn_); 394 } 395 if (supportsUnder_ != false) { 396 output.writeBool(2, supportsUnder_); 397 } 398 getUnknownFields().writeTo(output); 399 } 400 401 @java.lang.Override getSerializedSize()402 public int getSerializedSize() { 403 int size = memoizedSize; 404 if (size != -1) return size; 405 406 size = 0; 407 if (supportsIn_ != false) { 408 size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, supportsIn_); 409 } 410 if (supportsUnder_ != false) { 411 size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, supportsUnder_); 412 } 413 size += getUnknownFields().getSerializedSize(); 414 memoizedSize = size; 415 return size; 416 } 417 418 @java.lang.Override equals(final java.lang.Object obj)419 public boolean equals(final java.lang.Object obj) { 420 if (obj == this) { 421 return true; 422 } 423 if (!(obj instanceof com.google.cloud.orgpolicy.v2.Constraint.ListConstraint)) { 424 return super.equals(obj); 425 } 426 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint other = 427 (com.google.cloud.orgpolicy.v2.Constraint.ListConstraint) obj; 428 429 if (getSupportsIn() != other.getSupportsIn()) return false; 430 if (getSupportsUnder() != other.getSupportsUnder()) return false; 431 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 432 return true; 433 } 434 435 @java.lang.Override hashCode()436 public int hashCode() { 437 if (memoizedHashCode != 0) { 438 return memoizedHashCode; 439 } 440 int hash = 41; 441 hash = (19 * hash) + getDescriptor().hashCode(); 442 hash = (37 * hash) + SUPPORTS_IN_FIELD_NUMBER; 443 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSupportsIn()); 444 hash = (37 * hash) + SUPPORTS_UNDER_FIELD_NUMBER; 445 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSupportsUnder()); 446 hash = (29 * hash) + getUnknownFields().hashCode(); 447 memoizedHashCode = hash; 448 return hash; 449 } 450 parseFrom( java.nio.ByteBuffer data)451 public static com.google.cloud.orgpolicy.v2.Constraint.ListConstraint parseFrom( 452 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 453 return PARSER.parseFrom(data); 454 } 455 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)456 public static com.google.cloud.orgpolicy.v2.Constraint.ListConstraint parseFrom( 457 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 458 throws com.google.protobuf.InvalidProtocolBufferException { 459 return PARSER.parseFrom(data, extensionRegistry); 460 } 461 parseFrom( com.google.protobuf.ByteString data)462 public static com.google.cloud.orgpolicy.v2.Constraint.ListConstraint parseFrom( 463 com.google.protobuf.ByteString data) 464 throws com.google.protobuf.InvalidProtocolBufferException { 465 return PARSER.parseFrom(data); 466 } 467 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)468 public static com.google.cloud.orgpolicy.v2.Constraint.ListConstraint parseFrom( 469 com.google.protobuf.ByteString data, 470 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 471 throws com.google.protobuf.InvalidProtocolBufferException { 472 return PARSER.parseFrom(data, extensionRegistry); 473 } 474 parseFrom(byte[] data)475 public static com.google.cloud.orgpolicy.v2.Constraint.ListConstraint parseFrom(byte[] data) 476 throws com.google.protobuf.InvalidProtocolBufferException { 477 return PARSER.parseFrom(data); 478 } 479 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)480 public static com.google.cloud.orgpolicy.v2.Constraint.ListConstraint parseFrom( 481 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 482 throws com.google.protobuf.InvalidProtocolBufferException { 483 return PARSER.parseFrom(data, extensionRegistry); 484 } 485 parseFrom( java.io.InputStream input)486 public static com.google.cloud.orgpolicy.v2.Constraint.ListConstraint parseFrom( 487 java.io.InputStream input) throws java.io.IOException { 488 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 489 } 490 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)491 public static com.google.cloud.orgpolicy.v2.Constraint.ListConstraint parseFrom( 492 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 493 throws java.io.IOException { 494 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 495 PARSER, input, extensionRegistry); 496 } 497 parseDelimitedFrom( java.io.InputStream input)498 public static com.google.cloud.orgpolicy.v2.Constraint.ListConstraint parseDelimitedFrom( 499 java.io.InputStream input) throws java.io.IOException { 500 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 501 } 502 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)503 public static com.google.cloud.orgpolicy.v2.Constraint.ListConstraint parseDelimitedFrom( 504 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 505 throws java.io.IOException { 506 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 507 PARSER, input, extensionRegistry); 508 } 509 parseFrom( com.google.protobuf.CodedInputStream input)510 public static com.google.cloud.orgpolicy.v2.Constraint.ListConstraint parseFrom( 511 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 512 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 513 } 514 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)515 public static com.google.cloud.orgpolicy.v2.Constraint.ListConstraint parseFrom( 516 com.google.protobuf.CodedInputStream input, 517 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 518 throws java.io.IOException { 519 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 520 PARSER, input, extensionRegistry); 521 } 522 523 @java.lang.Override newBuilderForType()524 public Builder newBuilderForType() { 525 return newBuilder(); 526 } 527 newBuilder()528 public static Builder newBuilder() { 529 return DEFAULT_INSTANCE.toBuilder(); 530 } 531 newBuilder( com.google.cloud.orgpolicy.v2.Constraint.ListConstraint prototype)532 public static Builder newBuilder( 533 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint prototype) { 534 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 535 } 536 537 @java.lang.Override toBuilder()538 public Builder toBuilder() { 539 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 540 } 541 542 @java.lang.Override newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)543 protected Builder newBuilderForType( 544 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 545 Builder builder = new Builder(parent); 546 return builder; 547 } 548 /** 549 * 550 * 551 * <pre> 552 * A `Constraint` that allows or disallows a list of string values, which are 553 * configured by an Organization's policy administrator with a `Policy`. 554 * </pre> 555 * 556 * Protobuf type {@code google.cloud.orgpolicy.v2.Constraint.ListConstraint} 557 */ 558 public static final class Builder 559 extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 560 implements 561 // @@protoc_insertion_point(builder_implements:google.cloud.orgpolicy.v2.Constraint.ListConstraint) 562 com.google.cloud.orgpolicy.v2.Constraint.ListConstraintOrBuilder { getDescriptor()563 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 564 return com.google.cloud.orgpolicy.v2.ConstraintProto 565 .internal_static_google_cloud_orgpolicy_v2_Constraint_ListConstraint_descriptor; 566 } 567 568 @java.lang.Override 569 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()570 internalGetFieldAccessorTable() { 571 return com.google.cloud.orgpolicy.v2.ConstraintProto 572 .internal_static_google_cloud_orgpolicy_v2_Constraint_ListConstraint_fieldAccessorTable 573 .ensureFieldAccessorsInitialized( 574 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.class, 575 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.Builder.class); 576 } 577 578 // Construct using com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.newBuilder() Builder()579 private Builder() {} 580 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)581 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 582 super(parent); 583 } 584 585 @java.lang.Override clear()586 public Builder clear() { 587 super.clear(); 588 bitField0_ = 0; 589 supportsIn_ = false; 590 supportsUnder_ = false; 591 return this; 592 } 593 594 @java.lang.Override getDescriptorForType()595 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 596 return com.google.cloud.orgpolicy.v2.ConstraintProto 597 .internal_static_google_cloud_orgpolicy_v2_Constraint_ListConstraint_descriptor; 598 } 599 600 @java.lang.Override getDefaultInstanceForType()601 public com.google.cloud.orgpolicy.v2.Constraint.ListConstraint getDefaultInstanceForType() { 602 return com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.getDefaultInstance(); 603 } 604 605 @java.lang.Override build()606 public com.google.cloud.orgpolicy.v2.Constraint.ListConstraint build() { 607 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint result = buildPartial(); 608 if (!result.isInitialized()) { 609 throw newUninitializedMessageException(result); 610 } 611 return result; 612 } 613 614 @java.lang.Override buildPartial()615 public com.google.cloud.orgpolicy.v2.Constraint.ListConstraint buildPartial() { 616 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint result = 617 new com.google.cloud.orgpolicy.v2.Constraint.ListConstraint(this); 618 if (bitField0_ != 0) { 619 buildPartial0(result); 620 } 621 onBuilt(); 622 return result; 623 } 624 buildPartial0(com.google.cloud.orgpolicy.v2.Constraint.ListConstraint result)625 private void buildPartial0(com.google.cloud.orgpolicy.v2.Constraint.ListConstraint result) { 626 int from_bitField0_ = bitField0_; 627 if (((from_bitField0_ & 0x00000001) != 0)) { 628 result.supportsIn_ = supportsIn_; 629 } 630 if (((from_bitField0_ & 0x00000002) != 0)) { 631 result.supportsUnder_ = supportsUnder_; 632 } 633 } 634 635 @java.lang.Override clone()636 public Builder clone() { 637 return super.clone(); 638 } 639 640 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)641 public Builder setField( 642 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 643 return super.setField(field, value); 644 } 645 646 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)647 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 648 return super.clearField(field); 649 } 650 651 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)652 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 653 return super.clearOneof(oneof); 654 } 655 656 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)657 public Builder setRepeatedField( 658 com.google.protobuf.Descriptors.FieldDescriptor field, 659 int index, 660 java.lang.Object value) { 661 return super.setRepeatedField(field, index, value); 662 } 663 664 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)665 public Builder addRepeatedField( 666 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 667 return super.addRepeatedField(field, value); 668 } 669 670 @java.lang.Override mergeFrom(com.google.protobuf.Message other)671 public Builder mergeFrom(com.google.protobuf.Message other) { 672 if (other instanceof com.google.cloud.orgpolicy.v2.Constraint.ListConstraint) { 673 return mergeFrom((com.google.cloud.orgpolicy.v2.Constraint.ListConstraint) other); 674 } else { 675 super.mergeFrom(other); 676 return this; 677 } 678 } 679 mergeFrom(com.google.cloud.orgpolicy.v2.Constraint.ListConstraint other)680 public Builder mergeFrom(com.google.cloud.orgpolicy.v2.Constraint.ListConstraint other) { 681 if (other == com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.getDefaultInstance()) 682 return this; 683 if (other.getSupportsIn() != false) { 684 setSupportsIn(other.getSupportsIn()); 685 } 686 if (other.getSupportsUnder() != false) { 687 setSupportsUnder(other.getSupportsUnder()); 688 } 689 this.mergeUnknownFields(other.getUnknownFields()); 690 onChanged(); 691 return this; 692 } 693 694 @java.lang.Override isInitialized()695 public final boolean isInitialized() { 696 return true; 697 } 698 699 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)700 public Builder mergeFrom( 701 com.google.protobuf.CodedInputStream input, 702 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 703 throws java.io.IOException { 704 if (extensionRegistry == null) { 705 throw new java.lang.NullPointerException(); 706 } 707 try { 708 boolean done = false; 709 while (!done) { 710 int tag = input.readTag(); 711 switch (tag) { 712 case 0: 713 done = true; 714 break; 715 case 8: 716 { 717 supportsIn_ = input.readBool(); 718 bitField0_ |= 0x00000001; 719 break; 720 } // case 8 721 case 16: 722 { 723 supportsUnder_ = input.readBool(); 724 bitField0_ |= 0x00000002; 725 break; 726 } // case 16 727 default: 728 { 729 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 730 done = true; // was an endgroup tag 731 } 732 break; 733 } // default: 734 } // switch (tag) 735 } // while (!done) 736 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 737 throw e.unwrapIOException(); 738 } finally { 739 onChanged(); 740 } // finally 741 return this; 742 } 743 744 private int bitField0_; 745 746 private boolean supportsIn_; 747 /** 748 * 749 * 750 * <pre> 751 * Indicates whether values grouped into categories can be used in 752 * `Policy.allowed_values` and `Policy.denied_values`. For example, 753 * `"in:Python"` would match any value in the 'Python' group. 754 * </pre> 755 * 756 * <code>bool supports_in = 1;</code> 757 * 758 * @return The supportsIn. 759 */ 760 @java.lang.Override getSupportsIn()761 public boolean getSupportsIn() { 762 return supportsIn_; 763 } 764 /** 765 * 766 * 767 * <pre> 768 * Indicates whether values grouped into categories can be used in 769 * `Policy.allowed_values` and `Policy.denied_values`. For example, 770 * `"in:Python"` would match any value in the 'Python' group. 771 * </pre> 772 * 773 * <code>bool supports_in = 1;</code> 774 * 775 * @param value The supportsIn to set. 776 * @return This builder for chaining. 777 */ setSupportsIn(boolean value)778 public Builder setSupportsIn(boolean value) { 779 780 supportsIn_ = value; 781 bitField0_ |= 0x00000001; 782 onChanged(); 783 return this; 784 } 785 /** 786 * 787 * 788 * <pre> 789 * Indicates whether values grouped into categories can be used in 790 * `Policy.allowed_values` and `Policy.denied_values`. For example, 791 * `"in:Python"` would match any value in the 'Python' group. 792 * </pre> 793 * 794 * <code>bool supports_in = 1;</code> 795 * 796 * @return This builder for chaining. 797 */ clearSupportsIn()798 public Builder clearSupportsIn() { 799 bitField0_ = (bitField0_ & ~0x00000001); 800 supportsIn_ = false; 801 onChanged(); 802 return this; 803 } 804 805 private boolean supportsUnder_; 806 /** 807 * 808 * 809 * <pre> 810 * Indicates whether subtrees of Cloud Resource Manager resource hierarchy 811 * can be used in `Policy.allowed_values` and `Policy.denied_values`. For 812 * example, `"under:folders/123"` would match any resource under the 813 * 'folders/123' folder. 814 * </pre> 815 * 816 * <code>bool supports_under = 2;</code> 817 * 818 * @return The supportsUnder. 819 */ 820 @java.lang.Override getSupportsUnder()821 public boolean getSupportsUnder() { 822 return supportsUnder_; 823 } 824 /** 825 * 826 * 827 * <pre> 828 * Indicates whether subtrees of Cloud Resource Manager resource hierarchy 829 * can be used in `Policy.allowed_values` and `Policy.denied_values`. For 830 * example, `"under:folders/123"` would match any resource under the 831 * 'folders/123' folder. 832 * </pre> 833 * 834 * <code>bool supports_under = 2;</code> 835 * 836 * @param value The supportsUnder to set. 837 * @return This builder for chaining. 838 */ setSupportsUnder(boolean value)839 public Builder setSupportsUnder(boolean value) { 840 841 supportsUnder_ = value; 842 bitField0_ |= 0x00000002; 843 onChanged(); 844 return this; 845 } 846 /** 847 * 848 * 849 * <pre> 850 * Indicates whether subtrees of Cloud Resource Manager resource hierarchy 851 * can be used in `Policy.allowed_values` and `Policy.denied_values`. For 852 * example, `"under:folders/123"` would match any resource under the 853 * 'folders/123' folder. 854 * </pre> 855 * 856 * <code>bool supports_under = 2;</code> 857 * 858 * @return This builder for chaining. 859 */ clearSupportsUnder()860 public Builder clearSupportsUnder() { 861 bitField0_ = (bitField0_ & ~0x00000002); 862 supportsUnder_ = false; 863 onChanged(); 864 return this; 865 } 866 867 @java.lang.Override setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)868 public final Builder setUnknownFields( 869 final com.google.protobuf.UnknownFieldSet unknownFields) { 870 return super.setUnknownFields(unknownFields); 871 } 872 873 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)874 public final Builder mergeUnknownFields( 875 final com.google.protobuf.UnknownFieldSet unknownFields) { 876 return super.mergeUnknownFields(unknownFields); 877 } 878 879 // @@protoc_insertion_point(builder_scope:google.cloud.orgpolicy.v2.Constraint.ListConstraint) 880 } 881 882 // @@protoc_insertion_point(class_scope:google.cloud.orgpolicy.v2.Constraint.ListConstraint) 883 private static final com.google.cloud.orgpolicy.v2.Constraint.ListConstraint DEFAULT_INSTANCE; 884 885 static { 886 DEFAULT_INSTANCE = new com.google.cloud.orgpolicy.v2.Constraint.ListConstraint(); 887 } 888 getDefaultInstance()889 public static com.google.cloud.orgpolicy.v2.Constraint.ListConstraint getDefaultInstance() { 890 return DEFAULT_INSTANCE; 891 } 892 893 private static final com.google.protobuf.Parser<ListConstraint> PARSER = 894 new com.google.protobuf.AbstractParser<ListConstraint>() { 895 @java.lang.Override 896 public ListConstraint parsePartialFrom( 897 com.google.protobuf.CodedInputStream input, 898 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 899 throws com.google.protobuf.InvalidProtocolBufferException { 900 Builder builder = newBuilder(); 901 try { 902 builder.mergeFrom(input, extensionRegistry); 903 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 904 throw e.setUnfinishedMessage(builder.buildPartial()); 905 } catch (com.google.protobuf.UninitializedMessageException e) { 906 throw e.asInvalidProtocolBufferException() 907 .setUnfinishedMessage(builder.buildPartial()); 908 } catch (java.io.IOException e) { 909 throw new com.google.protobuf.InvalidProtocolBufferException(e) 910 .setUnfinishedMessage(builder.buildPartial()); 911 } 912 return builder.buildPartial(); 913 } 914 }; 915 parser()916 public static com.google.protobuf.Parser<ListConstraint> parser() { 917 return PARSER; 918 } 919 920 @java.lang.Override getParserForType()921 public com.google.protobuf.Parser<ListConstraint> getParserForType() { 922 return PARSER; 923 } 924 925 @java.lang.Override getDefaultInstanceForType()926 public com.google.cloud.orgpolicy.v2.Constraint.ListConstraint getDefaultInstanceForType() { 927 return DEFAULT_INSTANCE; 928 } 929 } 930 931 public interface BooleanConstraintOrBuilder 932 extends 933 // @@protoc_insertion_point(interface_extends:google.cloud.orgpolicy.v2.Constraint.BooleanConstraint) 934 com.google.protobuf.MessageOrBuilder {} 935 /** 936 * 937 * 938 * <pre> 939 * A `Constraint` that is either enforced or not. 940 * For example a constraint `constraints/compute.disableSerialPortAccess`. 941 * If it is enforced on a VM instance, serial port connections will not be 942 * opened to that instance. 943 * </pre> 944 * 945 * Protobuf type {@code google.cloud.orgpolicy.v2.Constraint.BooleanConstraint} 946 */ 947 public static final class BooleanConstraint extends com.google.protobuf.GeneratedMessageV3 948 implements 949 // @@protoc_insertion_point(message_implements:google.cloud.orgpolicy.v2.Constraint.BooleanConstraint) 950 BooleanConstraintOrBuilder { 951 private static final long serialVersionUID = 0L; 952 // Use BooleanConstraint.newBuilder() to construct. BooleanConstraint(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)953 private BooleanConstraint(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 954 super(builder); 955 } 956 BooleanConstraint()957 private BooleanConstraint() {} 958 959 @java.lang.Override 960 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)961 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 962 return new BooleanConstraint(); 963 } 964 965 @java.lang.Override getUnknownFields()966 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 967 return this.unknownFields; 968 } 969 getDescriptor()970 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 971 return com.google.cloud.orgpolicy.v2.ConstraintProto 972 .internal_static_google_cloud_orgpolicy_v2_Constraint_BooleanConstraint_descriptor; 973 } 974 975 @java.lang.Override 976 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()977 internalGetFieldAccessorTable() { 978 return com.google.cloud.orgpolicy.v2.ConstraintProto 979 .internal_static_google_cloud_orgpolicy_v2_Constraint_BooleanConstraint_fieldAccessorTable 980 .ensureFieldAccessorsInitialized( 981 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.class, 982 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.Builder.class); 983 } 984 985 private byte memoizedIsInitialized = -1; 986 987 @java.lang.Override isInitialized()988 public final boolean isInitialized() { 989 byte isInitialized = memoizedIsInitialized; 990 if (isInitialized == 1) return true; 991 if (isInitialized == 0) return false; 992 993 memoizedIsInitialized = 1; 994 return true; 995 } 996 997 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)998 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 999 getUnknownFields().writeTo(output); 1000 } 1001 1002 @java.lang.Override getSerializedSize()1003 public int getSerializedSize() { 1004 int size = memoizedSize; 1005 if (size != -1) return size; 1006 1007 size = 0; 1008 size += getUnknownFields().getSerializedSize(); 1009 memoizedSize = size; 1010 return size; 1011 } 1012 1013 @java.lang.Override equals(final java.lang.Object obj)1014 public boolean equals(final java.lang.Object obj) { 1015 if (obj == this) { 1016 return true; 1017 } 1018 if (!(obj instanceof com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint)) { 1019 return super.equals(obj); 1020 } 1021 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint other = 1022 (com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint) obj; 1023 1024 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 1025 return true; 1026 } 1027 1028 @java.lang.Override hashCode()1029 public int hashCode() { 1030 if (memoizedHashCode != 0) { 1031 return memoizedHashCode; 1032 } 1033 int hash = 41; 1034 hash = (19 * hash) + getDescriptor().hashCode(); 1035 hash = (29 * hash) + getUnknownFields().hashCode(); 1036 memoizedHashCode = hash; 1037 return hash; 1038 } 1039 parseFrom( java.nio.ByteBuffer data)1040 public static com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint parseFrom( 1041 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 1042 return PARSER.parseFrom(data); 1043 } 1044 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1045 public static com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint parseFrom( 1046 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1047 throws com.google.protobuf.InvalidProtocolBufferException { 1048 return PARSER.parseFrom(data, extensionRegistry); 1049 } 1050 parseFrom( com.google.protobuf.ByteString data)1051 public static com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint parseFrom( 1052 com.google.protobuf.ByteString data) 1053 throws com.google.protobuf.InvalidProtocolBufferException { 1054 return PARSER.parseFrom(data); 1055 } 1056 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1057 public static com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint parseFrom( 1058 com.google.protobuf.ByteString data, 1059 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1060 throws com.google.protobuf.InvalidProtocolBufferException { 1061 return PARSER.parseFrom(data, extensionRegistry); 1062 } 1063 parseFrom(byte[] data)1064 public static com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint parseFrom(byte[] data) 1065 throws com.google.protobuf.InvalidProtocolBufferException { 1066 return PARSER.parseFrom(data); 1067 } 1068 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1069 public static com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint parseFrom( 1070 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1071 throws com.google.protobuf.InvalidProtocolBufferException { 1072 return PARSER.parseFrom(data, extensionRegistry); 1073 } 1074 parseFrom( java.io.InputStream input)1075 public static com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint parseFrom( 1076 java.io.InputStream input) throws java.io.IOException { 1077 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1078 } 1079 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1080 public static com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint parseFrom( 1081 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1082 throws java.io.IOException { 1083 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1084 PARSER, input, extensionRegistry); 1085 } 1086 parseDelimitedFrom( java.io.InputStream input)1087 public static com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint parseDelimitedFrom( 1088 java.io.InputStream input) throws java.io.IOException { 1089 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 1090 } 1091 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1092 public static com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint parseDelimitedFrom( 1093 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1094 throws java.io.IOException { 1095 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 1096 PARSER, input, extensionRegistry); 1097 } 1098 parseFrom( com.google.protobuf.CodedInputStream input)1099 public static com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint parseFrom( 1100 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 1101 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1102 } 1103 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1104 public static com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint parseFrom( 1105 com.google.protobuf.CodedInputStream input, 1106 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1107 throws java.io.IOException { 1108 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1109 PARSER, input, extensionRegistry); 1110 } 1111 1112 @java.lang.Override newBuilderForType()1113 public Builder newBuilderForType() { 1114 return newBuilder(); 1115 } 1116 newBuilder()1117 public static Builder newBuilder() { 1118 return DEFAULT_INSTANCE.toBuilder(); 1119 } 1120 newBuilder( com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint prototype)1121 public static Builder newBuilder( 1122 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint prototype) { 1123 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 1124 } 1125 1126 @java.lang.Override toBuilder()1127 public Builder toBuilder() { 1128 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 1129 } 1130 1131 @java.lang.Override newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1132 protected Builder newBuilderForType( 1133 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1134 Builder builder = new Builder(parent); 1135 return builder; 1136 } 1137 /** 1138 * 1139 * 1140 * <pre> 1141 * A `Constraint` that is either enforced or not. 1142 * For example a constraint `constraints/compute.disableSerialPortAccess`. 1143 * If it is enforced on a VM instance, serial port connections will not be 1144 * opened to that instance. 1145 * </pre> 1146 * 1147 * Protobuf type {@code google.cloud.orgpolicy.v2.Constraint.BooleanConstraint} 1148 */ 1149 public static final class Builder 1150 extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 1151 implements 1152 // @@protoc_insertion_point(builder_implements:google.cloud.orgpolicy.v2.Constraint.BooleanConstraint) 1153 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraintOrBuilder { getDescriptor()1154 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 1155 return com.google.cloud.orgpolicy.v2.ConstraintProto 1156 .internal_static_google_cloud_orgpolicy_v2_Constraint_BooleanConstraint_descriptor; 1157 } 1158 1159 @java.lang.Override 1160 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()1161 internalGetFieldAccessorTable() { 1162 return com.google.cloud.orgpolicy.v2.ConstraintProto 1163 .internal_static_google_cloud_orgpolicy_v2_Constraint_BooleanConstraint_fieldAccessorTable 1164 .ensureFieldAccessorsInitialized( 1165 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.class, 1166 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.Builder.class); 1167 } 1168 1169 // Construct using com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.newBuilder() Builder()1170 private Builder() {} 1171 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1172 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1173 super(parent); 1174 } 1175 1176 @java.lang.Override clear()1177 public Builder clear() { 1178 super.clear(); 1179 return this; 1180 } 1181 1182 @java.lang.Override getDescriptorForType()1183 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 1184 return com.google.cloud.orgpolicy.v2.ConstraintProto 1185 .internal_static_google_cloud_orgpolicy_v2_Constraint_BooleanConstraint_descriptor; 1186 } 1187 1188 @java.lang.Override 1189 public com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint getDefaultInstanceForType()1190 getDefaultInstanceForType() { 1191 return com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.getDefaultInstance(); 1192 } 1193 1194 @java.lang.Override build()1195 public com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint build() { 1196 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint result = buildPartial(); 1197 if (!result.isInitialized()) { 1198 throw newUninitializedMessageException(result); 1199 } 1200 return result; 1201 } 1202 1203 @java.lang.Override buildPartial()1204 public com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint buildPartial() { 1205 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint result = 1206 new com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint(this); 1207 onBuilt(); 1208 return result; 1209 } 1210 1211 @java.lang.Override clone()1212 public Builder clone() { 1213 return super.clone(); 1214 } 1215 1216 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1217 public Builder setField( 1218 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1219 return super.setField(field, value); 1220 } 1221 1222 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1223 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 1224 return super.clearField(field); 1225 } 1226 1227 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1228 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 1229 return super.clearOneof(oneof); 1230 } 1231 1232 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1233 public Builder setRepeatedField( 1234 com.google.protobuf.Descriptors.FieldDescriptor field, 1235 int index, 1236 java.lang.Object value) { 1237 return super.setRepeatedField(field, index, value); 1238 } 1239 1240 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1241 public Builder addRepeatedField( 1242 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1243 return super.addRepeatedField(field, value); 1244 } 1245 1246 @java.lang.Override mergeFrom(com.google.protobuf.Message other)1247 public Builder mergeFrom(com.google.protobuf.Message other) { 1248 if (other instanceof com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint) { 1249 return mergeFrom((com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint) other); 1250 } else { 1251 super.mergeFrom(other); 1252 return this; 1253 } 1254 } 1255 mergeFrom(com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint other)1256 public Builder mergeFrom(com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint other) { 1257 if (other 1258 == com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.getDefaultInstance()) 1259 return this; 1260 this.mergeUnknownFields(other.getUnknownFields()); 1261 onChanged(); 1262 return this; 1263 } 1264 1265 @java.lang.Override isInitialized()1266 public final boolean isInitialized() { 1267 return true; 1268 } 1269 1270 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1271 public Builder mergeFrom( 1272 com.google.protobuf.CodedInputStream input, 1273 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1274 throws java.io.IOException { 1275 if (extensionRegistry == null) { 1276 throw new java.lang.NullPointerException(); 1277 } 1278 try { 1279 boolean done = false; 1280 while (!done) { 1281 int tag = input.readTag(); 1282 switch (tag) { 1283 case 0: 1284 done = true; 1285 break; 1286 default: 1287 { 1288 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 1289 done = true; // was an endgroup tag 1290 } 1291 break; 1292 } // default: 1293 } // switch (tag) 1294 } // while (!done) 1295 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1296 throw e.unwrapIOException(); 1297 } finally { 1298 onChanged(); 1299 } // finally 1300 return this; 1301 } 1302 1303 @java.lang.Override setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1304 public final Builder setUnknownFields( 1305 final com.google.protobuf.UnknownFieldSet unknownFields) { 1306 return super.setUnknownFields(unknownFields); 1307 } 1308 1309 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1310 public final Builder mergeUnknownFields( 1311 final com.google.protobuf.UnknownFieldSet unknownFields) { 1312 return super.mergeUnknownFields(unknownFields); 1313 } 1314 1315 // @@protoc_insertion_point(builder_scope:google.cloud.orgpolicy.v2.Constraint.BooleanConstraint) 1316 } 1317 1318 // @@protoc_insertion_point(class_scope:google.cloud.orgpolicy.v2.Constraint.BooleanConstraint) 1319 private static final com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint 1320 DEFAULT_INSTANCE; 1321 1322 static { 1323 DEFAULT_INSTANCE = new com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint(); 1324 } 1325 getDefaultInstance()1326 public static com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint getDefaultInstance() { 1327 return DEFAULT_INSTANCE; 1328 } 1329 1330 private static final com.google.protobuf.Parser<BooleanConstraint> PARSER = 1331 new com.google.protobuf.AbstractParser<BooleanConstraint>() { 1332 @java.lang.Override 1333 public BooleanConstraint parsePartialFrom( 1334 com.google.protobuf.CodedInputStream input, 1335 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1336 throws com.google.protobuf.InvalidProtocolBufferException { 1337 Builder builder = newBuilder(); 1338 try { 1339 builder.mergeFrom(input, extensionRegistry); 1340 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1341 throw e.setUnfinishedMessage(builder.buildPartial()); 1342 } catch (com.google.protobuf.UninitializedMessageException e) { 1343 throw e.asInvalidProtocolBufferException() 1344 .setUnfinishedMessage(builder.buildPartial()); 1345 } catch (java.io.IOException e) { 1346 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1347 .setUnfinishedMessage(builder.buildPartial()); 1348 } 1349 return builder.buildPartial(); 1350 } 1351 }; 1352 parser()1353 public static com.google.protobuf.Parser<BooleanConstraint> parser() { 1354 return PARSER; 1355 } 1356 1357 @java.lang.Override getParserForType()1358 public com.google.protobuf.Parser<BooleanConstraint> getParserForType() { 1359 return PARSER; 1360 } 1361 1362 @java.lang.Override getDefaultInstanceForType()1363 public com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint getDefaultInstanceForType() { 1364 return DEFAULT_INSTANCE; 1365 } 1366 } 1367 1368 private int constraintTypeCase_ = 0; 1369 private java.lang.Object constraintType_; 1370 1371 public enum ConstraintTypeCase 1372 implements 1373 com.google.protobuf.Internal.EnumLite, 1374 com.google.protobuf.AbstractMessage.InternalOneOfEnum { 1375 LIST_CONSTRAINT(5), 1376 BOOLEAN_CONSTRAINT(6), 1377 CONSTRAINTTYPE_NOT_SET(0); 1378 private final int value; 1379 ConstraintTypeCase(int value)1380 private ConstraintTypeCase(int value) { 1381 this.value = value; 1382 } 1383 /** 1384 * @param value The number of the enum to look for. 1385 * @return The enum associated with the given number. 1386 * @deprecated Use {@link #forNumber(int)} instead. 1387 */ 1388 @java.lang.Deprecated valueOf(int value)1389 public static ConstraintTypeCase valueOf(int value) { 1390 return forNumber(value); 1391 } 1392 forNumber(int value)1393 public static ConstraintTypeCase forNumber(int value) { 1394 switch (value) { 1395 case 5: 1396 return LIST_CONSTRAINT; 1397 case 6: 1398 return BOOLEAN_CONSTRAINT; 1399 case 0: 1400 return CONSTRAINTTYPE_NOT_SET; 1401 default: 1402 return null; 1403 } 1404 } 1405 getNumber()1406 public int getNumber() { 1407 return this.value; 1408 } 1409 }; 1410 getConstraintTypeCase()1411 public ConstraintTypeCase getConstraintTypeCase() { 1412 return ConstraintTypeCase.forNumber(constraintTypeCase_); 1413 } 1414 1415 public static final int NAME_FIELD_NUMBER = 1; 1416 1417 @SuppressWarnings("serial") 1418 private volatile java.lang.Object name_ = ""; 1419 /** 1420 * 1421 * 1422 * <pre> 1423 * Immutable. The resource name of the Constraint. Must be in one of 1424 * the following forms: 1425 * * `projects/{project_number}/constraints/{constraint_name}` 1426 * * `folders/{folder_id}/constraints/{constraint_name}` 1427 * * `organizations/{organization_id}/constraints/{constraint_name}` 1428 * For example, "/projects/123/constraints/compute.disableSerialPortAccess". 1429 * </pre> 1430 * 1431 * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 1432 * 1433 * @return The name. 1434 */ 1435 @java.lang.Override getName()1436 public java.lang.String getName() { 1437 java.lang.Object ref = name_; 1438 if (ref instanceof java.lang.String) { 1439 return (java.lang.String) ref; 1440 } else { 1441 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1442 java.lang.String s = bs.toStringUtf8(); 1443 name_ = s; 1444 return s; 1445 } 1446 } 1447 /** 1448 * 1449 * 1450 * <pre> 1451 * Immutable. The resource name of the Constraint. Must be in one of 1452 * the following forms: 1453 * * `projects/{project_number}/constraints/{constraint_name}` 1454 * * `folders/{folder_id}/constraints/{constraint_name}` 1455 * * `organizations/{organization_id}/constraints/{constraint_name}` 1456 * For example, "/projects/123/constraints/compute.disableSerialPortAccess". 1457 * </pre> 1458 * 1459 * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 1460 * 1461 * @return The bytes for name. 1462 */ 1463 @java.lang.Override getNameBytes()1464 public com.google.protobuf.ByteString getNameBytes() { 1465 java.lang.Object ref = name_; 1466 if (ref instanceof java.lang.String) { 1467 com.google.protobuf.ByteString b = 1468 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1469 name_ = b; 1470 return b; 1471 } else { 1472 return (com.google.protobuf.ByteString) ref; 1473 } 1474 } 1475 1476 public static final int DISPLAY_NAME_FIELD_NUMBER = 2; 1477 1478 @SuppressWarnings("serial") 1479 private volatile java.lang.Object displayName_ = ""; 1480 /** 1481 * 1482 * 1483 * <pre> 1484 * The human readable name. 1485 * Mutable. 1486 * </pre> 1487 * 1488 * <code>string display_name = 2;</code> 1489 * 1490 * @return The displayName. 1491 */ 1492 @java.lang.Override getDisplayName()1493 public java.lang.String getDisplayName() { 1494 java.lang.Object ref = displayName_; 1495 if (ref instanceof java.lang.String) { 1496 return (java.lang.String) ref; 1497 } else { 1498 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1499 java.lang.String s = bs.toStringUtf8(); 1500 displayName_ = s; 1501 return s; 1502 } 1503 } 1504 /** 1505 * 1506 * 1507 * <pre> 1508 * The human readable name. 1509 * Mutable. 1510 * </pre> 1511 * 1512 * <code>string display_name = 2;</code> 1513 * 1514 * @return The bytes for displayName. 1515 */ 1516 @java.lang.Override getDisplayNameBytes()1517 public com.google.protobuf.ByteString getDisplayNameBytes() { 1518 java.lang.Object ref = displayName_; 1519 if (ref instanceof java.lang.String) { 1520 com.google.protobuf.ByteString b = 1521 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1522 displayName_ = b; 1523 return b; 1524 } else { 1525 return (com.google.protobuf.ByteString) ref; 1526 } 1527 } 1528 1529 public static final int DESCRIPTION_FIELD_NUMBER = 3; 1530 1531 @SuppressWarnings("serial") 1532 private volatile java.lang.Object description_ = ""; 1533 /** 1534 * 1535 * 1536 * <pre> 1537 * Detailed description of what this `Constraint` controls as well as how and 1538 * where it is enforced. 1539 * Mutable. 1540 * </pre> 1541 * 1542 * <code>string description = 3;</code> 1543 * 1544 * @return The description. 1545 */ 1546 @java.lang.Override getDescription()1547 public java.lang.String getDescription() { 1548 java.lang.Object ref = description_; 1549 if (ref instanceof java.lang.String) { 1550 return (java.lang.String) ref; 1551 } else { 1552 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1553 java.lang.String s = bs.toStringUtf8(); 1554 description_ = s; 1555 return s; 1556 } 1557 } 1558 /** 1559 * 1560 * 1561 * <pre> 1562 * Detailed description of what this `Constraint` controls as well as how and 1563 * where it is enforced. 1564 * Mutable. 1565 * </pre> 1566 * 1567 * <code>string description = 3;</code> 1568 * 1569 * @return The bytes for description. 1570 */ 1571 @java.lang.Override getDescriptionBytes()1572 public com.google.protobuf.ByteString getDescriptionBytes() { 1573 java.lang.Object ref = description_; 1574 if (ref instanceof java.lang.String) { 1575 com.google.protobuf.ByteString b = 1576 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1577 description_ = b; 1578 return b; 1579 } else { 1580 return (com.google.protobuf.ByteString) ref; 1581 } 1582 } 1583 1584 public static final int CONSTRAINT_DEFAULT_FIELD_NUMBER = 4; 1585 private int constraintDefault_ = 0; 1586 /** 1587 * 1588 * 1589 * <pre> 1590 * The evaluation behavior of this constraint in the absence of 'Policy'. 1591 * </pre> 1592 * 1593 * <code>.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;</code> 1594 * 1595 * @return The enum numeric value on the wire for constraintDefault. 1596 */ 1597 @java.lang.Override getConstraintDefaultValue()1598 public int getConstraintDefaultValue() { 1599 return constraintDefault_; 1600 } 1601 /** 1602 * 1603 * 1604 * <pre> 1605 * The evaluation behavior of this constraint in the absence of 'Policy'. 1606 * </pre> 1607 * 1608 * <code>.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;</code> 1609 * 1610 * @return The constraintDefault. 1611 */ 1612 @java.lang.Override getConstraintDefault()1613 public com.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault getConstraintDefault() { 1614 com.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault result = 1615 com.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault.forNumber(constraintDefault_); 1616 return result == null 1617 ? com.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault.UNRECOGNIZED 1618 : result; 1619 } 1620 1621 public static final int LIST_CONSTRAINT_FIELD_NUMBER = 5; 1622 /** 1623 * 1624 * 1625 * <pre> 1626 * Defines this constraint as being a ListConstraint. 1627 * </pre> 1628 * 1629 * <code>.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;</code> 1630 * 1631 * @return Whether the listConstraint field is set. 1632 */ 1633 @java.lang.Override hasListConstraint()1634 public boolean hasListConstraint() { 1635 return constraintTypeCase_ == 5; 1636 } 1637 /** 1638 * 1639 * 1640 * <pre> 1641 * Defines this constraint as being a ListConstraint. 1642 * </pre> 1643 * 1644 * <code>.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;</code> 1645 * 1646 * @return The listConstraint. 1647 */ 1648 @java.lang.Override getListConstraint()1649 public com.google.cloud.orgpolicy.v2.Constraint.ListConstraint getListConstraint() { 1650 if (constraintTypeCase_ == 5) { 1651 return (com.google.cloud.orgpolicy.v2.Constraint.ListConstraint) constraintType_; 1652 } 1653 return com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.getDefaultInstance(); 1654 } 1655 /** 1656 * 1657 * 1658 * <pre> 1659 * Defines this constraint as being a ListConstraint. 1660 * </pre> 1661 * 1662 * <code>.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;</code> 1663 */ 1664 @java.lang.Override 1665 public com.google.cloud.orgpolicy.v2.Constraint.ListConstraintOrBuilder getListConstraintOrBuilder()1666 getListConstraintOrBuilder() { 1667 if (constraintTypeCase_ == 5) { 1668 return (com.google.cloud.orgpolicy.v2.Constraint.ListConstraint) constraintType_; 1669 } 1670 return com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.getDefaultInstance(); 1671 } 1672 1673 public static final int BOOLEAN_CONSTRAINT_FIELD_NUMBER = 6; 1674 /** 1675 * 1676 * 1677 * <pre> 1678 * Defines this constraint as being a BooleanConstraint. 1679 * </pre> 1680 * 1681 * <code>.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;</code> 1682 * 1683 * @return Whether the booleanConstraint field is set. 1684 */ 1685 @java.lang.Override hasBooleanConstraint()1686 public boolean hasBooleanConstraint() { 1687 return constraintTypeCase_ == 6; 1688 } 1689 /** 1690 * 1691 * 1692 * <pre> 1693 * Defines this constraint as being a BooleanConstraint. 1694 * </pre> 1695 * 1696 * <code>.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;</code> 1697 * 1698 * @return The booleanConstraint. 1699 */ 1700 @java.lang.Override getBooleanConstraint()1701 public com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint getBooleanConstraint() { 1702 if (constraintTypeCase_ == 6) { 1703 return (com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint) constraintType_; 1704 } 1705 return com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.getDefaultInstance(); 1706 } 1707 /** 1708 * 1709 * 1710 * <pre> 1711 * Defines this constraint as being a BooleanConstraint. 1712 * </pre> 1713 * 1714 * <code>.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;</code> 1715 */ 1716 @java.lang.Override 1717 public com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraintOrBuilder getBooleanConstraintOrBuilder()1718 getBooleanConstraintOrBuilder() { 1719 if (constraintTypeCase_ == 6) { 1720 return (com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint) constraintType_; 1721 } 1722 return com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.getDefaultInstance(); 1723 } 1724 1725 private byte memoizedIsInitialized = -1; 1726 1727 @java.lang.Override isInitialized()1728 public final boolean isInitialized() { 1729 byte isInitialized = memoizedIsInitialized; 1730 if (isInitialized == 1) return true; 1731 if (isInitialized == 0) return false; 1732 1733 memoizedIsInitialized = 1; 1734 return true; 1735 } 1736 1737 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)1738 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 1739 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 1740 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); 1741 } 1742 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { 1743 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); 1744 } 1745 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { 1746 com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); 1747 } 1748 if (constraintDefault_ 1749 != com.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault.CONSTRAINT_DEFAULT_UNSPECIFIED 1750 .getNumber()) { 1751 output.writeEnum(4, constraintDefault_); 1752 } 1753 if (constraintTypeCase_ == 5) { 1754 output.writeMessage( 1755 5, (com.google.cloud.orgpolicy.v2.Constraint.ListConstraint) constraintType_); 1756 } 1757 if (constraintTypeCase_ == 6) { 1758 output.writeMessage( 1759 6, (com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint) constraintType_); 1760 } 1761 getUnknownFields().writeTo(output); 1762 } 1763 1764 @java.lang.Override getSerializedSize()1765 public int getSerializedSize() { 1766 int size = memoizedSize; 1767 if (size != -1) return size; 1768 1769 size = 0; 1770 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 1771 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); 1772 } 1773 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { 1774 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); 1775 } 1776 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { 1777 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); 1778 } 1779 if (constraintDefault_ 1780 != com.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault.CONSTRAINT_DEFAULT_UNSPECIFIED 1781 .getNumber()) { 1782 size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, constraintDefault_); 1783 } 1784 if (constraintTypeCase_ == 5) { 1785 size += 1786 com.google.protobuf.CodedOutputStream.computeMessageSize( 1787 5, (com.google.cloud.orgpolicy.v2.Constraint.ListConstraint) constraintType_); 1788 } 1789 if (constraintTypeCase_ == 6) { 1790 size += 1791 com.google.protobuf.CodedOutputStream.computeMessageSize( 1792 6, (com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint) constraintType_); 1793 } 1794 size += getUnknownFields().getSerializedSize(); 1795 memoizedSize = size; 1796 return size; 1797 } 1798 1799 @java.lang.Override equals(final java.lang.Object obj)1800 public boolean equals(final java.lang.Object obj) { 1801 if (obj == this) { 1802 return true; 1803 } 1804 if (!(obj instanceof com.google.cloud.orgpolicy.v2.Constraint)) { 1805 return super.equals(obj); 1806 } 1807 com.google.cloud.orgpolicy.v2.Constraint other = (com.google.cloud.orgpolicy.v2.Constraint) obj; 1808 1809 if (!getName().equals(other.getName())) return false; 1810 if (!getDisplayName().equals(other.getDisplayName())) return false; 1811 if (!getDescription().equals(other.getDescription())) return false; 1812 if (constraintDefault_ != other.constraintDefault_) return false; 1813 if (!getConstraintTypeCase().equals(other.getConstraintTypeCase())) return false; 1814 switch (constraintTypeCase_) { 1815 case 5: 1816 if (!getListConstraint().equals(other.getListConstraint())) return false; 1817 break; 1818 case 6: 1819 if (!getBooleanConstraint().equals(other.getBooleanConstraint())) return false; 1820 break; 1821 case 0: 1822 default: 1823 } 1824 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 1825 return true; 1826 } 1827 1828 @java.lang.Override hashCode()1829 public int hashCode() { 1830 if (memoizedHashCode != 0) { 1831 return memoizedHashCode; 1832 } 1833 int hash = 41; 1834 hash = (19 * hash) + getDescriptor().hashCode(); 1835 hash = (37 * hash) + NAME_FIELD_NUMBER; 1836 hash = (53 * hash) + getName().hashCode(); 1837 hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; 1838 hash = (53 * hash) + getDisplayName().hashCode(); 1839 hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; 1840 hash = (53 * hash) + getDescription().hashCode(); 1841 hash = (37 * hash) + CONSTRAINT_DEFAULT_FIELD_NUMBER; 1842 hash = (53 * hash) + constraintDefault_; 1843 switch (constraintTypeCase_) { 1844 case 5: 1845 hash = (37 * hash) + LIST_CONSTRAINT_FIELD_NUMBER; 1846 hash = (53 * hash) + getListConstraint().hashCode(); 1847 break; 1848 case 6: 1849 hash = (37 * hash) + BOOLEAN_CONSTRAINT_FIELD_NUMBER; 1850 hash = (53 * hash) + getBooleanConstraint().hashCode(); 1851 break; 1852 case 0: 1853 default: 1854 } 1855 hash = (29 * hash) + getUnknownFields().hashCode(); 1856 memoizedHashCode = hash; 1857 return hash; 1858 } 1859 parseFrom(java.nio.ByteBuffer data)1860 public static com.google.cloud.orgpolicy.v2.Constraint parseFrom(java.nio.ByteBuffer data) 1861 throws com.google.protobuf.InvalidProtocolBufferException { 1862 return PARSER.parseFrom(data); 1863 } 1864 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1865 public static com.google.cloud.orgpolicy.v2.Constraint parseFrom( 1866 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1867 throws com.google.protobuf.InvalidProtocolBufferException { 1868 return PARSER.parseFrom(data, extensionRegistry); 1869 } 1870 parseFrom( com.google.protobuf.ByteString data)1871 public static com.google.cloud.orgpolicy.v2.Constraint parseFrom( 1872 com.google.protobuf.ByteString data) 1873 throws com.google.protobuf.InvalidProtocolBufferException { 1874 return PARSER.parseFrom(data); 1875 } 1876 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1877 public static com.google.cloud.orgpolicy.v2.Constraint parseFrom( 1878 com.google.protobuf.ByteString data, 1879 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1880 throws com.google.protobuf.InvalidProtocolBufferException { 1881 return PARSER.parseFrom(data, extensionRegistry); 1882 } 1883 parseFrom(byte[] data)1884 public static com.google.cloud.orgpolicy.v2.Constraint parseFrom(byte[] data) 1885 throws com.google.protobuf.InvalidProtocolBufferException { 1886 return PARSER.parseFrom(data); 1887 } 1888 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1889 public static com.google.cloud.orgpolicy.v2.Constraint parseFrom( 1890 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1891 throws com.google.protobuf.InvalidProtocolBufferException { 1892 return PARSER.parseFrom(data, extensionRegistry); 1893 } 1894 parseFrom(java.io.InputStream input)1895 public static com.google.cloud.orgpolicy.v2.Constraint parseFrom(java.io.InputStream input) 1896 throws java.io.IOException { 1897 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1898 } 1899 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1900 public static com.google.cloud.orgpolicy.v2.Constraint parseFrom( 1901 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1902 throws java.io.IOException { 1903 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1904 PARSER, input, extensionRegistry); 1905 } 1906 parseDelimitedFrom( java.io.InputStream input)1907 public static com.google.cloud.orgpolicy.v2.Constraint parseDelimitedFrom( 1908 java.io.InputStream input) throws java.io.IOException { 1909 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 1910 } 1911 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1912 public static com.google.cloud.orgpolicy.v2.Constraint parseDelimitedFrom( 1913 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1914 throws java.io.IOException { 1915 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 1916 PARSER, input, extensionRegistry); 1917 } 1918 parseFrom( com.google.protobuf.CodedInputStream input)1919 public static com.google.cloud.orgpolicy.v2.Constraint parseFrom( 1920 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 1921 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1922 } 1923 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1924 public static com.google.cloud.orgpolicy.v2.Constraint parseFrom( 1925 com.google.protobuf.CodedInputStream input, 1926 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1927 throws java.io.IOException { 1928 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1929 PARSER, input, extensionRegistry); 1930 } 1931 1932 @java.lang.Override newBuilderForType()1933 public Builder newBuilderForType() { 1934 return newBuilder(); 1935 } 1936 newBuilder()1937 public static Builder newBuilder() { 1938 return DEFAULT_INSTANCE.toBuilder(); 1939 } 1940 newBuilder(com.google.cloud.orgpolicy.v2.Constraint prototype)1941 public static Builder newBuilder(com.google.cloud.orgpolicy.v2.Constraint prototype) { 1942 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 1943 } 1944 1945 @java.lang.Override toBuilder()1946 public Builder toBuilder() { 1947 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 1948 } 1949 1950 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1951 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1952 Builder builder = new Builder(parent); 1953 return builder; 1954 } 1955 /** 1956 * 1957 * 1958 * <pre> 1959 * A `constraint` describes a way to restrict resource's configuration. For 1960 * example, you could enforce a constraint that controls which cloud services 1961 * can be activated across an organization, or whether a Compute Engine instance 1962 * can have serial port connections established. `Constraints` can be configured 1963 * by the organization's policy administrator to fit the needs of the 1964 * organization by setting a `policy` that includes `constraints` at different 1965 * locations in the organization's resource hierarchy. Policies are inherited 1966 * down the resource hierarchy from higher levels, but can also be overridden. 1967 * For details about the inheritance rules please read about 1968 * [`policies`][google.cloud.OrgPolicy.v2.Policy]. 1969 * `Constraints` have a default behavior determined by the `constraint_default` 1970 * field, which is the enforcement behavior that is used in the absence of a 1971 * `policy` being defined or inherited for the resource in question. 1972 * </pre> 1973 * 1974 * Protobuf type {@code google.cloud.orgpolicy.v2.Constraint} 1975 */ 1976 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 1977 implements 1978 // @@protoc_insertion_point(builder_implements:google.cloud.orgpolicy.v2.Constraint) 1979 com.google.cloud.orgpolicy.v2.ConstraintOrBuilder { getDescriptor()1980 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 1981 return com.google.cloud.orgpolicy.v2.ConstraintProto 1982 .internal_static_google_cloud_orgpolicy_v2_Constraint_descriptor; 1983 } 1984 1985 @java.lang.Override 1986 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()1987 internalGetFieldAccessorTable() { 1988 return com.google.cloud.orgpolicy.v2.ConstraintProto 1989 .internal_static_google_cloud_orgpolicy_v2_Constraint_fieldAccessorTable 1990 .ensureFieldAccessorsInitialized( 1991 com.google.cloud.orgpolicy.v2.Constraint.class, 1992 com.google.cloud.orgpolicy.v2.Constraint.Builder.class); 1993 } 1994 1995 // Construct using com.google.cloud.orgpolicy.v2.Constraint.newBuilder() Builder()1996 private Builder() {} 1997 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1998 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1999 super(parent); 2000 } 2001 2002 @java.lang.Override clear()2003 public Builder clear() { 2004 super.clear(); 2005 bitField0_ = 0; 2006 name_ = ""; 2007 displayName_ = ""; 2008 description_ = ""; 2009 constraintDefault_ = 0; 2010 if (listConstraintBuilder_ != null) { 2011 listConstraintBuilder_.clear(); 2012 } 2013 if (booleanConstraintBuilder_ != null) { 2014 booleanConstraintBuilder_.clear(); 2015 } 2016 constraintTypeCase_ = 0; 2017 constraintType_ = null; 2018 return this; 2019 } 2020 2021 @java.lang.Override getDescriptorForType()2022 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 2023 return com.google.cloud.orgpolicy.v2.ConstraintProto 2024 .internal_static_google_cloud_orgpolicy_v2_Constraint_descriptor; 2025 } 2026 2027 @java.lang.Override getDefaultInstanceForType()2028 public com.google.cloud.orgpolicy.v2.Constraint getDefaultInstanceForType() { 2029 return com.google.cloud.orgpolicy.v2.Constraint.getDefaultInstance(); 2030 } 2031 2032 @java.lang.Override build()2033 public com.google.cloud.orgpolicy.v2.Constraint build() { 2034 com.google.cloud.orgpolicy.v2.Constraint result = buildPartial(); 2035 if (!result.isInitialized()) { 2036 throw newUninitializedMessageException(result); 2037 } 2038 return result; 2039 } 2040 2041 @java.lang.Override buildPartial()2042 public com.google.cloud.orgpolicy.v2.Constraint buildPartial() { 2043 com.google.cloud.orgpolicy.v2.Constraint result = 2044 new com.google.cloud.orgpolicy.v2.Constraint(this); 2045 if (bitField0_ != 0) { 2046 buildPartial0(result); 2047 } 2048 buildPartialOneofs(result); 2049 onBuilt(); 2050 return result; 2051 } 2052 buildPartial0(com.google.cloud.orgpolicy.v2.Constraint result)2053 private void buildPartial0(com.google.cloud.orgpolicy.v2.Constraint result) { 2054 int from_bitField0_ = bitField0_; 2055 if (((from_bitField0_ & 0x00000001) != 0)) { 2056 result.name_ = name_; 2057 } 2058 if (((from_bitField0_ & 0x00000002) != 0)) { 2059 result.displayName_ = displayName_; 2060 } 2061 if (((from_bitField0_ & 0x00000004) != 0)) { 2062 result.description_ = description_; 2063 } 2064 if (((from_bitField0_ & 0x00000008) != 0)) { 2065 result.constraintDefault_ = constraintDefault_; 2066 } 2067 } 2068 buildPartialOneofs(com.google.cloud.orgpolicy.v2.Constraint result)2069 private void buildPartialOneofs(com.google.cloud.orgpolicy.v2.Constraint result) { 2070 result.constraintTypeCase_ = constraintTypeCase_; 2071 result.constraintType_ = this.constraintType_; 2072 if (constraintTypeCase_ == 5 && listConstraintBuilder_ != null) { 2073 result.constraintType_ = listConstraintBuilder_.build(); 2074 } 2075 if (constraintTypeCase_ == 6 && booleanConstraintBuilder_ != null) { 2076 result.constraintType_ = booleanConstraintBuilder_.build(); 2077 } 2078 } 2079 2080 @java.lang.Override clone()2081 public Builder clone() { 2082 return super.clone(); 2083 } 2084 2085 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2086 public Builder setField( 2087 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 2088 return super.setField(field, value); 2089 } 2090 2091 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)2092 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 2093 return super.clearField(field); 2094 } 2095 2096 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)2097 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 2098 return super.clearOneof(oneof); 2099 } 2100 2101 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)2102 public Builder setRepeatedField( 2103 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 2104 return super.setRepeatedField(field, index, value); 2105 } 2106 2107 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2108 public Builder addRepeatedField( 2109 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 2110 return super.addRepeatedField(field, value); 2111 } 2112 2113 @java.lang.Override mergeFrom(com.google.protobuf.Message other)2114 public Builder mergeFrom(com.google.protobuf.Message other) { 2115 if (other instanceof com.google.cloud.orgpolicy.v2.Constraint) { 2116 return mergeFrom((com.google.cloud.orgpolicy.v2.Constraint) other); 2117 } else { 2118 super.mergeFrom(other); 2119 return this; 2120 } 2121 } 2122 mergeFrom(com.google.cloud.orgpolicy.v2.Constraint other)2123 public Builder mergeFrom(com.google.cloud.orgpolicy.v2.Constraint other) { 2124 if (other == com.google.cloud.orgpolicy.v2.Constraint.getDefaultInstance()) return this; 2125 if (!other.getName().isEmpty()) { 2126 name_ = other.name_; 2127 bitField0_ |= 0x00000001; 2128 onChanged(); 2129 } 2130 if (!other.getDisplayName().isEmpty()) { 2131 displayName_ = other.displayName_; 2132 bitField0_ |= 0x00000002; 2133 onChanged(); 2134 } 2135 if (!other.getDescription().isEmpty()) { 2136 description_ = other.description_; 2137 bitField0_ |= 0x00000004; 2138 onChanged(); 2139 } 2140 if (other.constraintDefault_ != 0) { 2141 setConstraintDefaultValue(other.getConstraintDefaultValue()); 2142 } 2143 switch (other.getConstraintTypeCase()) { 2144 case LIST_CONSTRAINT: 2145 { 2146 mergeListConstraint(other.getListConstraint()); 2147 break; 2148 } 2149 case BOOLEAN_CONSTRAINT: 2150 { 2151 mergeBooleanConstraint(other.getBooleanConstraint()); 2152 break; 2153 } 2154 case CONSTRAINTTYPE_NOT_SET: 2155 { 2156 break; 2157 } 2158 } 2159 this.mergeUnknownFields(other.getUnknownFields()); 2160 onChanged(); 2161 return this; 2162 } 2163 2164 @java.lang.Override isInitialized()2165 public final boolean isInitialized() { 2166 return true; 2167 } 2168 2169 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2170 public Builder mergeFrom( 2171 com.google.protobuf.CodedInputStream input, 2172 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2173 throws java.io.IOException { 2174 if (extensionRegistry == null) { 2175 throw new java.lang.NullPointerException(); 2176 } 2177 try { 2178 boolean done = false; 2179 while (!done) { 2180 int tag = input.readTag(); 2181 switch (tag) { 2182 case 0: 2183 done = true; 2184 break; 2185 case 10: 2186 { 2187 name_ = input.readStringRequireUtf8(); 2188 bitField0_ |= 0x00000001; 2189 break; 2190 } // case 10 2191 case 18: 2192 { 2193 displayName_ = input.readStringRequireUtf8(); 2194 bitField0_ |= 0x00000002; 2195 break; 2196 } // case 18 2197 case 26: 2198 { 2199 description_ = input.readStringRequireUtf8(); 2200 bitField0_ |= 0x00000004; 2201 break; 2202 } // case 26 2203 case 32: 2204 { 2205 constraintDefault_ = input.readEnum(); 2206 bitField0_ |= 0x00000008; 2207 break; 2208 } // case 32 2209 case 42: 2210 { 2211 input.readMessage(getListConstraintFieldBuilder().getBuilder(), extensionRegistry); 2212 constraintTypeCase_ = 5; 2213 break; 2214 } // case 42 2215 case 50: 2216 { 2217 input.readMessage( 2218 getBooleanConstraintFieldBuilder().getBuilder(), extensionRegistry); 2219 constraintTypeCase_ = 6; 2220 break; 2221 } // case 50 2222 default: 2223 { 2224 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 2225 done = true; // was an endgroup tag 2226 } 2227 break; 2228 } // default: 2229 } // switch (tag) 2230 } // while (!done) 2231 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 2232 throw e.unwrapIOException(); 2233 } finally { 2234 onChanged(); 2235 } // finally 2236 return this; 2237 } 2238 2239 private int constraintTypeCase_ = 0; 2240 private java.lang.Object constraintType_; 2241 getConstraintTypeCase()2242 public ConstraintTypeCase getConstraintTypeCase() { 2243 return ConstraintTypeCase.forNumber(constraintTypeCase_); 2244 } 2245 clearConstraintType()2246 public Builder clearConstraintType() { 2247 constraintTypeCase_ = 0; 2248 constraintType_ = null; 2249 onChanged(); 2250 return this; 2251 } 2252 2253 private int bitField0_; 2254 2255 private java.lang.Object name_ = ""; 2256 /** 2257 * 2258 * 2259 * <pre> 2260 * Immutable. The resource name of the Constraint. Must be in one of 2261 * the following forms: 2262 * * `projects/{project_number}/constraints/{constraint_name}` 2263 * * `folders/{folder_id}/constraints/{constraint_name}` 2264 * * `organizations/{organization_id}/constraints/{constraint_name}` 2265 * For example, "/projects/123/constraints/compute.disableSerialPortAccess". 2266 * </pre> 2267 * 2268 * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 2269 * 2270 * @return The name. 2271 */ getName()2272 public java.lang.String getName() { 2273 java.lang.Object ref = name_; 2274 if (!(ref instanceof java.lang.String)) { 2275 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2276 java.lang.String s = bs.toStringUtf8(); 2277 name_ = s; 2278 return s; 2279 } else { 2280 return (java.lang.String) ref; 2281 } 2282 } 2283 /** 2284 * 2285 * 2286 * <pre> 2287 * Immutable. The resource name of the Constraint. Must be in one of 2288 * the following forms: 2289 * * `projects/{project_number}/constraints/{constraint_name}` 2290 * * `folders/{folder_id}/constraints/{constraint_name}` 2291 * * `organizations/{organization_id}/constraints/{constraint_name}` 2292 * For example, "/projects/123/constraints/compute.disableSerialPortAccess". 2293 * </pre> 2294 * 2295 * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 2296 * 2297 * @return The bytes for name. 2298 */ getNameBytes()2299 public com.google.protobuf.ByteString getNameBytes() { 2300 java.lang.Object ref = name_; 2301 if (ref instanceof String) { 2302 com.google.protobuf.ByteString b = 2303 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2304 name_ = b; 2305 return b; 2306 } else { 2307 return (com.google.protobuf.ByteString) ref; 2308 } 2309 } 2310 /** 2311 * 2312 * 2313 * <pre> 2314 * Immutable. The resource name of the Constraint. Must be in one of 2315 * the following forms: 2316 * * `projects/{project_number}/constraints/{constraint_name}` 2317 * * `folders/{folder_id}/constraints/{constraint_name}` 2318 * * `organizations/{organization_id}/constraints/{constraint_name}` 2319 * For example, "/projects/123/constraints/compute.disableSerialPortAccess". 2320 * </pre> 2321 * 2322 * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 2323 * 2324 * @param value The name to set. 2325 * @return This builder for chaining. 2326 */ setName(java.lang.String value)2327 public Builder setName(java.lang.String value) { 2328 if (value == null) { 2329 throw new NullPointerException(); 2330 } 2331 name_ = value; 2332 bitField0_ |= 0x00000001; 2333 onChanged(); 2334 return this; 2335 } 2336 /** 2337 * 2338 * 2339 * <pre> 2340 * Immutable. The resource name of the Constraint. Must be in one of 2341 * the following forms: 2342 * * `projects/{project_number}/constraints/{constraint_name}` 2343 * * `folders/{folder_id}/constraints/{constraint_name}` 2344 * * `organizations/{organization_id}/constraints/{constraint_name}` 2345 * For example, "/projects/123/constraints/compute.disableSerialPortAccess". 2346 * </pre> 2347 * 2348 * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 2349 * 2350 * @return This builder for chaining. 2351 */ clearName()2352 public Builder clearName() { 2353 name_ = getDefaultInstance().getName(); 2354 bitField0_ = (bitField0_ & ~0x00000001); 2355 onChanged(); 2356 return this; 2357 } 2358 /** 2359 * 2360 * 2361 * <pre> 2362 * Immutable. The resource name of the Constraint. Must be in one of 2363 * the following forms: 2364 * * `projects/{project_number}/constraints/{constraint_name}` 2365 * * `folders/{folder_id}/constraints/{constraint_name}` 2366 * * `organizations/{organization_id}/constraints/{constraint_name}` 2367 * For example, "/projects/123/constraints/compute.disableSerialPortAccess". 2368 * </pre> 2369 * 2370 * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 2371 * 2372 * @param value The bytes for name to set. 2373 * @return This builder for chaining. 2374 */ setNameBytes(com.google.protobuf.ByteString value)2375 public Builder setNameBytes(com.google.protobuf.ByteString value) { 2376 if (value == null) { 2377 throw new NullPointerException(); 2378 } 2379 checkByteStringIsUtf8(value); 2380 name_ = value; 2381 bitField0_ |= 0x00000001; 2382 onChanged(); 2383 return this; 2384 } 2385 2386 private java.lang.Object displayName_ = ""; 2387 /** 2388 * 2389 * 2390 * <pre> 2391 * The human readable name. 2392 * Mutable. 2393 * </pre> 2394 * 2395 * <code>string display_name = 2;</code> 2396 * 2397 * @return The displayName. 2398 */ getDisplayName()2399 public java.lang.String getDisplayName() { 2400 java.lang.Object ref = displayName_; 2401 if (!(ref instanceof java.lang.String)) { 2402 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2403 java.lang.String s = bs.toStringUtf8(); 2404 displayName_ = s; 2405 return s; 2406 } else { 2407 return (java.lang.String) ref; 2408 } 2409 } 2410 /** 2411 * 2412 * 2413 * <pre> 2414 * The human readable name. 2415 * Mutable. 2416 * </pre> 2417 * 2418 * <code>string display_name = 2;</code> 2419 * 2420 * @return The bytes for displayName. 2421 */ getDisplayNameBytes()2422 public com.google.protobuf.ByteString getDisplayNameBytes() { 2423 java.lang.Object ref = displayName_; 2424 if (ref instanceof String) { 2425 com.google.protobuf.ByteString b = 2426 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2427 displayName_ = b; 2428 return b; 2429 } else { 2430 return (com.google.protobuf.ByteString) ref; 2431 } 2432 } 2433 /** 2434 * 2435 * 2436 * <pre> 2437 * The human readable name. 2438 * Mutable. 2439 * </pre> 2440 * 2441 * <code>string display_name = 2;</code> 2442 * 2443 * @param value The displayName to set. 2444 * @return This builder for chaining. 2445 */ setDisplayName(java.lang.String value)2446 public Builder setDisplayName(java.lang.String value) { 2447 if (value == null) { 2448 throw new NullPointerException(); 2449 } 2450 displayName_ = value; 2451 bitField0_ |= 0x00000002; 2452 onChanged(); 2453 return this; 2454 } 2455 /** 2456 * 2457 * 2458 * <pre> 2459 * The human readable name. 2460 * Mutable. 2461 * </pre> 2462 * 2463 * <code>string display_name = 2;</code> 2464 * 2465 * @return This builder for chaining. 2466 */ clearDisplayName()2467 public Builder clearDisplayName() { 2468 displayName_ = getDefaultInstance().getDisplayName(); 2469 bitField0_ = (bitField0_ & ~0x00000002); 2470 onChanged(); 2471 return this; 2472 } 2473 /** 2474 * 2475 * 2476 * <pre> 2477 * The human readable name. 2478 * Mutable. 2479 * </pre> 2480 * 2481 * <code>string display_name = 2;</code> 2482 * 2483 * @param value The bytes for displayName to set. 2484 * @return This builder for chaining. 2485 */ setDisplayNameBytes(com.google.protobuf.ByteString value)2486 public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { 2487 if (value == null) { 2488 throw new NullPointerException(); 2489 } 2490 checkByteStringIsUtf8(value); 2491 displayName_ = value; 2492 bitField0_ |= 0x00000002; 2493 onChanged(); 2494 return this; 2495 } 2496 2497 private java.lang.Object description_ = ""; 2498 /** 2499 * 2500 * 2501 * <pre> 2502 * Detailed description of what this `Constraint` controls as well as how and 2503 * where it is enforced. 2504 * Mutable. 2505 * </pre> 2506 * 2507 * <code>string description = 3;</code> 2508 * 2509 * @return The description. 2510 */ getDescription()2511 public java.lang.String getDescription() { 2512 java.lang.Object ref = description_; 2513 if (!(ref instanceof java.lang.String)) { 2514 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2515 java.lang.String s = bs.toStringUtf8(); 2516 description_ = s; 2517 return s; 2518 } else { 2519 return (java.lang.String) ref; 2520 } 2521 } 2522 /** 2523 * 2524 * 2525 * <pre> 2526 * Detailed description of what this `Constraint` controls as well as how and 2527 * where it is enforced. 2528 * Mutable. 2529 * </pre> 2530 * 2531 * <code>string description = 3;</code> 2532 * 2533 * @return The bytes for description. 2534 */ getDescriptionBytes()2535 public com.google.protobuf.ByteString getDescriptionBytes() { 2536 java.lang.Object ref = description_; 2537 if (ref instanceof String) { 2538 com.google.protobuf.ByteString b = 2539 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2540 description_ = b; 2541 return b; 2542 } else { 2543 return (com.google.protobuf.ByteString) ref; 2544 } 2545 } 2546 /** 2547 * 2548 * 2549 * <pre> 2550 * Detailed description of what this `Constraint` controls as well as how and 2551 * where it is enforced. 2552 * Mutable. 2553 * </pre> 2554 * 2555 * <code>string description = 3;</code> 2556 * 2557 * @param value The description to set. 2558 * @return This builder for chaining. 2559 */ setDescription(java.lang.String value)2560 public Builder setDescription(java.lang.String value) { 2561 if (value == null) { 2562 throw new NullPointerException(); 2563 } 2564 description_ = value; 2565 bitField0_ |= 0x00000004; 2566 onChanged(); 2567 return this; 2568 } 2569 /** 2570 * 2571 * 2572 * <pre> 2573 * Detailed description of what this `Constraint` controls as well as how and 2574 * where it is enforced. 2575 * Mutable. 2576 * </pre> 2577 * 2578 * <code>string description = 3;</code> 2579 * 2580 * @return This builder for chaining. 2581 */ clearDescription()2582 public Builder clearDescription() { 2583 description_ = getDefaultInstance().getDescription(); 2584 bitField0_ = (bitField0_ & ~0x00000004); 2585 onChanged(); 2586 return this; 2587 } 2588 /** 2589 * 2590 * 2591 * <pre> 2592 * Detailed description of what this `Constraint` controls as well as how and 2593 * where it is enforced. 2594 * Mutable. 2595 * </pre> 2596 * 2597 * <code>string description = 3;</code> 2598 * 2599 * @param value The bytes for description to set. 2600 * @return This builder for chaining. 2601 */ setDescriptionBytes(com.google.protobuf.ByteString value)2602 public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { 2603 if (value == null) { 2604 throw new NullPointerException(); 2605 } 2606 checkByteStringIsUtf8(value); 2607 description_ = value; 2608 bitField0_ |= 0x00000004; 2609 onChanged(); 2610 return this; 2611 } 2612 2613 private int constraintDefault_ = 0; 2614 /** 2615 * 2616 * 2617 * <pre> 2618 * The evaluation behavior of this constraint in the absence of 'Policy'. 2619 * </pre> 2620 * 2621 * <code>.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;</code> 2622 * 2623 * @return The enum numeric value on the wire for constraintDefault. 2624 */ 2625 @java.lang.Override getConstraintDefaultValue()2626 public int getConstraintDefaultValue() { 2627 return constraintDefault_; 2628 } 2629 /** 2630 * 2631 * 2632 * <pre> 2633 * The evaluation behavior of this constraint in the absence of 'Policy'. 2634 * </pre> 2635 * 2636 * <code>.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;</code> 2637 * 2638 * @param value The enum numeric value on the wire for constraintDefault to set. 2639 * @return This builder for chaining. 2640 */ setConstraintDefaultValue(int value)2641 public Builder setConstraintDefaultValue(int value) { 2642 constraintDefault_ = value; 2643 bitField0_ |= 0x00000008; 2644 onChanged(); 2645 return this; 2646 } 2647 /** 2648 * 2649 * 2650 * <pre> 2651 * The evaluation behavior of this constraint in the absence of 'Policy'. 2652 * </pre> 2653 * 2654 * <code>.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;</code> 2655 * 2656 * @return The constraintDefault. 2657 */ 2658 @java.lang.Override getConstraintDefault()2659 public com.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault getConstraintDefault() { 2660 com.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault result = 2661 com.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault.forNumber(constraintDefault_); 2662 return result == null 2663 ? com.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault.UNRECOGNIZED 2664 : result; 2665 } 2666 /** 2667 * 2668 * 2669 * <pre> 2670 * The evaluation behavior of this constraint in the absence of 'Policy'. 2671 * </pre> 2672 * 2673 * <code>.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;</code> 2674 * 2675 * @param value The constraintDefault to set. 2676 * @return This builder for chaining. 2677 */ setConstraintDefault( com.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault value)2678 public Builder setConstraintDefault( 2679 com.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault value) { 2680 if (value == null) { 2681 throw new NullPointerException(); 2682 } 2683 bitField0_ |= 0x00000008; 2684 constraintDefault_ = value.getNumber(); 2685 onChanged(); 2686 return this; 2687 } 2688 /** 2689 * 2690 * 2691 * <pre> 2692 * The evaluation behavior of this constraint in the absence of 'Policy'. 2693 * </pre> 2694 * 2695 * <code>.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault constraint_default = 4;</code> 2696 * 2697 * @return This builder for chaining. 2698 */ clearConstraintDefault()2699 public Builder clearConstraintDefault() { 2700 bitField0_ = (bitField0_ & ~0x00000008); 2701 constraintDefault_ = 0; 2702 onChanged(); 2703 return this; 2704 } 2705 2706 private com.google.protobuf.SingleFieldBuilderV3< 2707 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint, 2708 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.Builder, 2709 com.google.cloud.orgpolicy.v2.Constraint.ListConstraintOrBuilder> 2710 listConstraintBuilder_; 2711 /** 2712 * 2713 * 2714 * <pre> 2715 * Defines this constraint as being a ListConstraint. 2716 * </pre> 2717 * 2718 * <code>.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;</code> 2719 * 2720 * @return Whether the listConstraint field is set. 2721 */ 2722 @java.lang.Override hasListConstraint()2723 public boolean hasListConstraint() { 2724 return constraintTypeCase_ == 5; 2725 } 2726 /** 2727 * 2728 * 2729 * <pre> 2730 * Defines this constraint as being a ListConstraint. 2731 * </pre> 2732 * 2733 * <code>.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;</code> 2734 * 2735 * @return The listConstraint. 2736 */ 2737 @java.lang.Override getListConstraint()2738 public com.google.cloud.orgpolicy.v2.Constraint.ListConstraint getListConstraint() { 2739 if (listConstraintBuilder_ == null) { 2740 if (constraintTypeCase_ == 5) { 2741 return (com.google.cloud.orgpolicy.v2.Constraint.ListConstraint) constraintType_; 2742 } 2743 return com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.getDefaultInstance(); 2744 } else { 2745 if (constraintTypeCase_ == 5) { 2746 return listConstraintBuilder_.getMessage(); 2747 } 2748 return com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.getDefaultInstance(); 2749 } 2750 } 2751 /** 2752 * 2753 * 2754 * <pre> 2755 * Defines this constraint as being a ListConstraint. 2756 * </pre> 2757 * 2758 * <code>.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;</code> 2759 */ setListConstraint( com.google.cloud.orgpolicy.v2.Constraint.ListConstraint value)2760 public Builder setListConstraint( 2761 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint value) { 2762 if (listConstraintBuilder_ == null) { 2763 if (value == null) { 2764 throw new NullPointerException(); 2765 } 2766 constraintType_ = value; 2767 onChanged(); 2768 } else { 2769 listConstraintBuilder_.setMessage(value); 2770 } 2771 constraintTypeCase_ = 5; 2772 return this; 2773 } 2774 /** 2775 * 2776 * 2777 * <pre> 2778 * Defines this constraint as being a ListConstraint. 2779 * </pre> 2780 * 2781 * <code>.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;</code> 2782 */ setListConstraint( com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.Builder builderForValue)2783 public Builder setListConstraint( 2784 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.Builder builderForValue) { 2785 if (listConstraintBuilder_ == null) { 2786 constraintType_ = builderForValue.build(); 2787 onChanged(); 2788 } else { 2789 listConstraintBuilder_.setMessage(builderForValue.build()); 2790 } 2791 constraintTypeCase_ = 5; 2792 return this; 2793 } 2794 /** 2795 * 2796 * 2797 * <pre> 2798 * Defines this constraint as being a ListConstraint. 2799 * </pre> 2800 * 2801 * <code>.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;</code> 2802 */ mergeListConstraint( com.google.cloud.orgpolicy.v2.Constraint.ListConstraint value)2803 public Builder mergeListConstraint( 2804 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint value) { 2805 if (listConstraintBuilder_ == null) { 2806 if (constraintTypeCase_ == 5 2807 && constraintType_ 2808 != com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.getDefaultInstance()) { 2809 constraintType_ = 2810 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.newBuilder( 2811 (com.google.cloud.orgpolicy.v2.Constraint.ListConstraint) constraintType_) 2812 .mergeFrom(value) 2813 .buildPartial(); 2814 } else { 2815 constraintType_ = value; 2816 } 2817 onChanged(); 2818 } else { 2819 if (constraintTypeCase_ == 5) { 2820 listConstraintBuilder_.mergeFrom(value); 2821 } else { 2822 listConstraintBuilder_.setMessage(value); 2823 } 2824 } 2825 constraintTypeCase_ = 5; 2826 return this; 2827 } 2828 /** 2829 * 2830 * 2831 * <pre> 2832 * Defines this constraint as being a ListConstraint. 2833 * </pre> 2834 * 2835 * <code>.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;</code> 2836 */ clearListConstraint()2837 public Builder clearListConstraint() { 2838 if (listConstraintBuilder_ == null) { 2839 if (constraintTypeCase_ == 5) { 2840 constraintTypeCase_ = 0; 2841 constraintType_ = null; 2842 onChanged(); 2843 } 2844 } else { 2845 if (constraintTypeCase_ == 5) { 2846 constraintTypeCase_ = 0; 2847 constraintType_ = null; 2848 } 2849 listConstraintBuilder_.clear(); 2850 } 2851 return this; 2852 } 2853 /** 2854 * 2855 * 2856 * <pre> 2857 * Defines this constraint as being a ListConstraint. 2858 * </pre> 2859 * 2860 * <code>.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;</code> 2861 */ 2862 public com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.Builder getListConstraintBuilder()2863 getListConstraintBuilder() { 2864 return getListConstraintFieldBuilder().getBuilder(); 2865 } 2866 /** 2867 * 2868 * 2869 * <pre> 2870 * Defines this constraint as being a ListConstraint. 2871 * </pre> 2872 * 2873 * <code>.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;</code> 2874 */ 2875 @java.lang.Override 2876 public com.google.cloud.orgpolicy.v2.Constraint.ListConstraintOrBuilder getListConstraintOrBuilder()2877 getListConstraintOrBuilder() { 2878 if ((constraintTypeCase_ == 5) && (listConstraintBuilder_ != null)) { 2879 return listConstraintBuilder_.getMessageOrBuilder(); 2880 } else { 2881 if (constraintTypeCase_ == 5) { 2882 return (com.google.cloud.orgpolicy.v2.Constraint.ListConstraint) constraintType_; 2883 } 2884 return com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.getDefaultInstance(); 2885 } 2886 } 2887 /** 2888 * 2889 * 2890 * <pre> 2891 * Defines this constraint as being a ListConstraint. 2892 * </pre> 2893 * 2894 * <code>.google.cloud.orgpolicy.v2.Constraint.ListConstraint list_constraint = 5;</code> 2895 */ 2896 private com.google.protobuf.SingleFieldBuilderV3< 2897 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint, 2898 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.Builder, 2899 com.google.cloud.orgpolicy.v2.Constraint.ListConstraintOrBuilder> getListConstraintFieldBuilder()2900 getListConstraintFieldBuilder() { 2901 if (listConstraintBuilder_ == null) { 2902 if (!(constraintTypeCase_ == 5)) { 2903 constraintType_ = 2904 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.getDefaultInstance(); 2905 } 2906 listConstraintBuilder_ = 2907 new com.google.protobuf.SingleFieldBuilderV3< 2908 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint, 2909 com.google.cloud.orgpolicy.v2.Constraint.ListConstraint.Builder, 2910 com.google.cloud.orgpolicy.v2.Constraint.ListConstraintOrBuilder>( 2911 (com.google.cloud.orgpolicy.v2.Constraint.ListConstraint) constraintType_, 2912 getParentForChildren(), 2913 isClean()); 2914 constraintType_ = null; 2915 } 2916 constraintTypeCase_ = 5; 2917 onChanged(); 2918 return listConstraintBuilder_; 2919 } 2920 2921 private com.google.protobuf.SingleFieldBuilderV3< 2922 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint, 2923 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.Builder, 2924 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraintOrBuilder> 2925 booleanConstraintBuilder_; 2926 /** 2927 * 2928 * 2929 * <pre> 2930 * Defines this constraint as being a BooleanConstraint. 2931 * </pre> 2932 * 2933 * <code>.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;</code> 2934 * 2935 * @return Whether the booleanConstraint field is set. 2936 */ 2937 @java.lang.Override hasBooleanConstraint()2938 public boolean hasBooleanConstraint() { 2939 return constraintTypeCase_ == 6; 2940 } 2941 /** 2942 * 2943 * 2944 * <pre> 2945 * Defines this constraint as being a BooleanConstraint. 2946 * </pre> 2947 * 2948 * <code>.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;</code> 2949 * 2950 * @return The booleanConstraint. 2951 */ 2952 @java.lang.Override getBooleanConstraint()2953 public com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint getBooleanConstraint() { 2954 if (booleanConstraintBuilder_ == null) { 2955 if (constraintTypeCase_ == 6) { 2956 return (com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint) constraintType_; 2957 } 2958 return com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.getDefaultInstance(); 2959 } else { 2960 if (constraintTypeCase_ == 6) { 2961 return booleanConstraintBuilder_.getMessage(); 2962 } 2963 return com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.getDefaultInstance(); 2964 } 2965 } 2966 /** 2967 * 2968 * 2969 * <pre> 2970 * Defines this constraint as being a BooleanConstraint. 2971 * </pre> 2972 * 2973 * <code>.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;</code> 2974 */ setBooleanConstraint( com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint value)2975 public Builder setBooleanConstraint( 2976 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint value) { 2977 if (booleanConstraintBuilder_ == null) { 2978 if (value == null) { 2979 throw new NullPointerException(); 2980 } 2981 constraintType_ = value; 2982 onChanged(); 2983 } else { 2984 booleanConstraintBuilder_.setMessage(value); 2985 } 2986 constraintTypeCase_ = 6; 2987 return this; 2988 } 2989 /** 2990 * 2991 * 2992 * <pre> 2993 * Defines this constraint as being a BooleanConstraint. 2994 * </pre> 2995 * 2996 * <code>.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;</code> 2997 */ setBooleanConstraint( com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.Builder builderForValue)2998 public Builder setBooleanConstraint( 2999 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.Builder builderForValue) { 3000 if (booleanConstraintBuilder_ == null) { 3001 constraintType_ = builderForValue.build(); 3002 onChanged(); 3003 } else { 3004 booleanConstraintBuilder_.setMessage(builderForValue.build()); 3005 } 3006 constraintTypeCase_ = 6; 3007 return this; 3008 } 3009 /** 3010 * 3011 * 3012 * <pre> 3013 * Defines this constraint as being a BooleanConstraint. 3014 * </pre> 3015 * 3016 * <code>.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;</code> 3017 */ mergeBooleanConstraint( com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint value)3018 public Builder mergeBooleanConstraint( 3019 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint value) { 3020 if (booleanConstraintBuilder_ == null) { 3021 if (constraintTypeCase_ == 6 3022 && constraintType_ 3023 != com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint 3024 .getDefaultInstance()) { 3025 constraintType_ = 3026 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.newBuilder( 3027 (com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint) constraintType_) 3028 .mergeFrom(value) 3029 .buildPartial(); 3030 } else { 3031 constraintType_ = value; 3032 } 3033 onChanged(); 3034 } else { 3035 if (constraintTypeCase_ == 6) { 3036 booleanConstraintBuilder_.mergeFrom(value); 3037 } else { 3038 booleanConstraintBuilder_.setMessage(value); 3039 } 3040 } 3041 constraintTypeCase_ = 6; 3042 return this; 3043 } 3044 /** 3045 * 3046 * 3047 * <pre> 3048 * Defines this constraint as being a BooleanConstraint. 3049 * </pre> 3050 * 3051 * <code>.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;</code> 3052 */ clearBooleanConstraint()3053 public Builder clearBooleanConstraint() { 3054 if (booleanConstraintBuilder_ == null) { 3055 if (constraintTypeCase_ == 6) { 3056 constraintTypeCase_ = 0; 3057 constraintType_ = null; 3058 onChanged(); 3059 } 3060 } else { 3061 if (constraintTypeCase_ == 6) { 3062 constraintTypeCase_ = 0; 3063 constraintType_ = null; 3064 } 3065 booleanConstraintBuilder_.clear(); 3066 } 3067 return this; 3068 } 3069 /** 3070 * 3071 * 3072 * <pre> 3073 * Defines this constraint as being a BooleanConstraint. 3074 * </pre> 3075 * 3076 * <code>.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;</code> 3077 */ 3078 public com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.Builder getBooleanConstraintBuilder()3079 getBooleanConstraintBuilder() { 3080 return getBooleanConstraintFieldBuilder().getBuilder(); 3081 } 3082 /** 3083 * 3084 * 3085 * <pre> 3086 * Defines this constraint as being a BooleanConstraint. 3087 * </pre> 3088 * 3089 * <code>.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;</code> 3090 */ 3091 @java.lang.Override 3092 public com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraintOrBuilder getBooleanConstraintOrBuilder()3093 getBooleanConstraintOrBuilder() { 3094 if ((constraintTypeCase_ == 6) && (booleanConstraintBuilder_ != null)) { 3095 return booleanConstraintBuilder_.getMessageOrBuilder(); 3096 } else { 3097 if (constraintTypeCase_ == 6) { 3098 return (com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint) constraintType_; 3099 } 3100 return com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.getDefaultInstance(); 3101 } 3102 } 3103 /** 3104 * 3105 * 3106 * <pre> 3107 * Defines this constraint as being a BooleanConstraint. 3108 * </pre> 3109 * 3110 * <code>.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint boolean_constraint = 6;</code> 3111 */ 3112 private com.google.protobuf.SingleFieldBuilderV3< 3113 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint, 3114 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.Builder, 3115 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraintOrBuilder> getBooleanConstraintFieldBuilder()3116 getBooleanConstraintFieldBuilder() { 3117 if (booleanConstraintBuilder_ == null) { 3118 if (!(constraintTypeCase_ == 6)) { 3119 constraintType_ = 3120 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.getDefaultInstance(); 3121 } 3122 booleanConstraintBuilder_ = 3123 new com.google.protobuf.SingleFieldBuilderV3< 3124 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint, 3125 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint.Builder, 3126 com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraintOrBuilder>( 3127 (com.google.cloud.orgpolicy.v2.Constraint.BooleanConstraint) constraintType_, 3128 getParentForChildren(), 3129 isClean()); 3130 constraintType_ = null; 3131 } 3132 constraintTypeCase_ = 6; 3133 onChanged(); 3134 return booleanConstraintBuilder_; 3135 } 3136 3137 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)3138 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 3139 return super.setUnknownFields(unknownFields); 3140 } 3141 3142 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)3143 public final Builder mergeUnknownFields( 3144 final com.google.protobuf.UnknownFieldSet unknownFields) { 3145 return super.mergeUnknownFields(unknownFields); 3146 } 3147 3148 // @@protoc_insertion_point(builder_scope:google.cloud.orgpolicy.v2.Constraint) 3149 } 3150 3151 // @@protoc_insertion_point(class_scope:google.cloud.orgpolicy.v2.Constraint) 3152 private static final com.google.cloud.orgpolicy.v2.Constraint DEFAULT_INSTANCE; 3153 3154 static { 3155 DEFAULT_INSTANCE = new com.google.cloud.orgpolicy.v2.Constraint(); 3156 } 3157 getDefaultInstance()3158 public static com.google.cloud.orgpolicy.v2.Constraint getDefaultInstance() { 3159 return DEFAULT_INSTANCE; 3160 } 3161 3162 private static final com.google.protobuf.Parser<Constraint> PARSER = 3163 new com.google.protobuf.AbstractParser<Constraint>() { 3164 @java.lang.Override 3165 public Constraint parsePartialFrom( 3166 com.google.protobuf.CodedInputStream input, 3167 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 3168 throws com.google.protobuf.InvalidProtocolBufferException { 3169 Builder builder = newBuilder(); 3170 try { 3171 builder.mergeFrom(input, extensionRegistry); 3172 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 3173 throw e.setUnfinishedMessage(builder.buildPartial()); 3174 } catch (com.google.protobuf.UninitializedMessageException e) { 3175 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 3176 } catch (java.io.IOException e) { 3177 throw new com.google.protobuf.InvalidProtocolBufferException(e) 3178 .setUnfinishedMessage(builder.buildPartial()); 3179 } 3180 return builder.buildPartial(); 3181 } 3182 }; 3183 parser()3184 public static com.google.protobuf.Parser<Constraint> parser() { 3185 return PARSER; 3186 } 3187 3188 @java.lang.Override getParserForType()3189 public com.google.protobuf.Parser<Constraint> getParserForType() { 3190 return PARSER; 3191 } 3192 3193 @java.lang.Override getDefaultInstanceForType()3194 public com.google.cloud.orgpolicy.v2.Constraint getDefaultInstanceForType() { 3195 return DEFAULT_INSTANCE; 3196 } 3197 } 3198