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