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/asset/v1/assets.proto 18 19 package com.google.cloud.asset.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * A result of IAM Policy search, containing information of an IAM policy. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.asset.v1.IamPolicySearchResult} 29 */ 30 public final class IamPolicySearchResult extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.asset.v1.IamPolicySearchResult) 33 IamPolicySearchResultOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use IamPolicySearchResult.newBuilder() to construct. IamPolicySearchResult(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private IamPolicySearchResult(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 IamPolicySearchResult()40 private IamPolicySearchResult() { 41 resource_ = ""; 42 assetType_ = ""; 43 project_ = ""; 44 folders_ = com.google.protobuf.LazyStringArrayList.EMPTY; 45 organization_ = ""; 46 } 47 48 @java.lang.Override 49 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)50 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 51 return new IamPolicySearchResult(); 52 } 53 54 @java.lang.Override getUnknownFields()55 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 56 return this.unknownFields; 57 } 58 getDescriptor()59 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 60 return com.google.cloud.asset.v1.AssetProto 61 .internal_static_google_cloud_asset_v1_IamPolicySearchResult_descriptor; 62 } 63 64 @java.lang.Override 65 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()66 internalGetFieldAccessorTable() { 67 return com.google.cloud.asset.v1.AssetProto 68 .internal_static_google_cloud_asset_v1_IamPolicySearchResult_fieldAccessorTable 69 .ensureFieldAccessorsInitialized( 70 com.google.cloud.asset.v1.IamPolicySearchResult.class, 71 com.google.cloud.asset.v1.IamPolicySearchResult.Builder.class); 72 } 73 74 public interface ExplanationOrBuilder 75 extends 76 // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1.IamPolicySearchResult.Explanation) 77 com.google.protobuf.MessageOrBuilder { 78 79 /** 80 * 81 * 82 * <pre> 83 * The map from roles to their included permissions that match the 84 * permission query (i.e., a query containing `policy.role.permissions:`). 85 * Example: if query `policy.role.permissions:compute.disk.get` 86 * matches a policy binding that contains owner role, the 87 * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The 88 * roles can also be found in the returned `policy` bindings. Note that the 89 * map is populated only for requests with permission queries. 90 * </pre> 91 * 92 * <code> 93 * map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1; 94 * </code> 95 */ getMatchedPermissionsCount()96 int getMatchedPermissionsCount(); 97 /** 98 * 99 * 100 * <pre> 101 * The map from roles to their included permissions that match the 102 * permission query (i.e., a query containing `policy.role.permissions:`). 103 * Example: if query `policy.role.permissions:compute.disk.get` 104 * matches a policy binding that contains owner role, the 105 * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The 106 * roles can also be found in the returned `policy` bindings. Note that the 107 * map is populated only for requests with permission queries. 108 * </pre> 109 * 110 * <code> 111 * map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1; 112 * </code> 113 */ containsMatchedPermissions(java.lang.String key)114 boolean containsMatchedPermissions(java.lang.String key); 115 /** Use {@link #getMatchedPermissionsMap()} instead. */ 116 @java.lang.Deprecated 117 java.util.Map< 118 java.lang.String, 119 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> getMatchedPermissions()120 getMatchedPermissions(); 121 /** 122 * 123 * 124 * <pre> 125 * The map from roles to their included permissions that match the 126 * permission query (i.e., a query containing `policy.role.permissions:`). 127 * Example: if query `policy.role.permissions:compute.disk.get` 128 * matches a policy binding that contains owner role, the 129 * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The 130 * roles can also be found in the returned `policy` bindings. Note that the 131 * map is populated only for requests with permission queries. 132 * </pre> 133 * 134 * <code> 135 * map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1; 136 * </code> 137 */ 138 java.util.Map< 139 java.lang.String, 140 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> getMatchedPermissionsMap()141 getMatchedPermissionsMap(); 142 /** 143 * 144 * 145 * <pre> 146 * The map from roles to their included permissions that match the 147 * permission query (i.e., a query containing `policy.role.permissions:`). 148 * Example: if query `policy.role.permissions:compute.disk.get` 149 * matches a policy binding that contains owner role, the 150 * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The 151 * roles can also be found in the returned `policy` bindings. Note that the 152 * map is populated only for requests with permission queries. 153 * </pre> 154 * 155 * <code> 156 * map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1; 157 * </code> 158 */ 159 /* nullable */ 160 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions getMatchedPermissionsOrDefault( java.lang.String key, com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions defaultValue)161 getMatchedPermissionsOrDefault( 162 java.lang.String key, 163 /* nullable */ 164 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions defaultValue); 165 /** 166 * 167 * 168 * <pre> 169 * The map from roles to their included permissions that match the 170 * permission query (i.e., a query containing `policy.role.permissions:`). 171 * Example: if query `policy.role.permissions:compute.disk.get` 172 * matches a policy binding that contains owner role, the 173 * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The 174 * roles can also be found in the returned `policy` bindings. Note that the 175 * map is populated only for requests with permission queries. 176 * </pre> 177 * 178 * <code> 179 * map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1; 180 * </code> 181 */ 182 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions getMatchedPermissionsOrThrow(java.lang.String key)183 getMatchedPermissionsOrThrow(java.lang.String key); 184 } 185 /** 186 * 187 * 188 * <pre> 189 * Explanation about the IAM policy search result. 190 * </pre> 191 * 192 * Protobuf type {@code google.cloud.asset.v1.IamPolicySearchResult.Explanation} 193 */ 194 public static final class Explanation extends com.google.protobuf.GeneratedMessageV3 195 implements 196 // @@protoc_insertion_point(message_implements:google.cloud.asset.v1.IamPolicySearchResult.Explanation) 197 ExplanationOrBuilder { 198 private static final long serialVersionUID = 0L; 199 // Use Explanation.newBuilder() to construct. Explanation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)200 private Explanation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 201 super(builder); 202 } 203 Explanation()204 private Explanation() {} 205 206 @java.lang.Override 207 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)208 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 209 return new Explanation(); 210 } 211 212 @java.lang.Override getUnknownFields()213 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 214 return this.unknownFields; 215 } 216 getDescriptor()217 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 218 return com.google.cloud.asset.v1.AssetProto 219 .internal_static_google_cloud_asset_v1_IamPolicySearchResult_Explanation_descriptor; 220 } 221 222 @SuppressWarnings({"rawtypes"}) 223 @java.lang.Override internalGetMapField(int number)224 protected com.google.protobuf.MapField internalGetMapField(int number) { 225 switch (number) { 226 case 1: 227 return internalGetMatchedPermissions(); 228 default: 229 throw new RuntimeException("Invalid map field number: " + number); 230 } 231 } 232 233 @java.lang.Override 234 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()235 internalGetFieldAccessorTable() { 236 return com.google.cloud.asset.v1.AssetProto 237 .internal_static_google_cloud_asset_v1_IamPolicySearchResult_Explanation_fieldAccessorTable 238 .ensureFieldAccessorsInitialized( 239 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.class, 240 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Builder.class); 241 } 242 243 public interface PermissionsOrBuilder 244 extends 245 // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions) 246 com.google.protobuf.MessageOrBuilder { 247 248 /** 249 * 250 * 251 * <pre> 252 * A list of permissions. A sample permission string: `compute.disk.get`. 253 * </pre> 254 * 255 * <code>repeated string permissions = 1;</code> 256 * 257 * @return A list containing the permissions. 258 */ getPermissionsList()259 java.util.List<java.lang.String> getPermissionsList(); 260 /** 261 * 262 * 263 * <pre> 264 * A list of permissions. A sample permission string: `compute.disk.get`. 265 * </pre> 266 * 267 * <code>repeated string permissions = 1;</code> 268 * 269 * @return The count of permissions. 270 */ getPermissionsCount()271 int getPermissionsCount(); 272 /** 273 * 274 * 275 * <pre> 276 * A list of permissions. A sample permission string: `compute.disk.get`. 277 * </pre> 278 * 279 * <code>repeated string permissions = 1;</code> 280 * 281 * @param index The index of the element to return. 282 * @return The permissions at the given index. 283 */ getPermissions(int index)284 java.lang.String getPermissions(int index); 285 /** 286 * 287 * 288 * <pre> 289 * A list of permissions. A sample permission string: `compute.disk.get`. 290 * </pre> 291 * 292 * <code>repeated string permissions = 1;</code> 293 * 294 * @param index The index of the value to return. 295 * @return The bytes of the permissions at the given index. 296 */ getPermissionsBytes(int index)297 com.google.protobuf.ByteString getPermissionsBytes(int index); 298 } 299 /** 300 * 301 * 302 * <pre> 303 * IAM permissions 304 * </pre> 305 * 306 * Protobuf type {@code google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} 307 */ 308 public static final class Permissions extends com.google.protobuf.GeneratedMessageV3 309 implements 310 // @@protoc_insertion_point(message_implements:google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions) 311 PermissionsOrBuilder { 312 private static final long serialVersionUID = 0L; 313 // Use Permissions.newBuilder() to construct. Permissions(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)314 private Permissions(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 315 super(builder); 316 } 317 Permissions()318 private Permissions() { 319 permissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; 320 } 321 322 @java.lang.Override 323 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)324 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 325 return new Permissions(); 326 } 327 328 @java.lang.Override getUnknownFields()329 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 330 return this.unknownFields; 331 } 332 getDescriptor()333 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 334 return com.google.cloud.asset.v1.AssetProto 335 .internal_static_google_cloud_asset_v1_IamPolicySearchResult_Explanation_Permissions_descriptor; 336 } 337 338 @java.lang.Override 339 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()340 internalGetFieldAccessorTable() { 341 return com.google.cloud.asset.v1.AssetProto 342 .internal_static_google_cloud_asset_v1_IamPolicySearchResult_Explanation_Permissions_fieldAccessorTable 343 .ensureFieldAccessorsInitialized( 344 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.class, 345 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.Builder 346 .class); 347 } 348 349 public static final int PERMISSIONS_FIELD_NUMBER = 1; 350 351 @SuppressWarnings("serial") 352 private com.google.protobuf.LazyStringList permissions_; 353 /** 354 * 355 * 356 * <pre> 357 * A list of permissions. A sample permission string: `compute.disk.get`. 358 * </pre> 359 * 360 * <code>repeated string permissions = 1;</code> 361 * 362 * @return A list containing the permissions. 363 */ getPermissionsList()364 public com.google.protobuf.ProtocolStringList getPermissionsList() { 365 return permissions_; 366 } 367 /** 368 * 369 * 370 * <pre> 371 * A list of permissions. A sample permission string: `compute.disk.get`. 372 * </pre> 373 * 374 * <code>repeated string permissions = 1;</code> 375 * 376 * @return The count of permissions. 377 */ getPermissionsCount()378 public int getPermissionsCount() { 379 return permissions_.size(); 380 } 381 /** 382 * 383 * 384 * <pre> 385 * A list of permissions. A sample permission string: `compute.disk.get`. 386 * </pre> 387 * 388 * <code>repeated string permissions = 1;</code> 389 * 390 * @param index The index of the element to return. 391 * @return The permissions at the given index. 392 */ getPermissions(int index)393 public java.lang.String getPermissions(int index) { 394 return permissions_.get(index); 395 } 396 /** 397 * 398 * 399 * <pre> 400 * A list of permissions. A sample permission string: `compute.disk.get`. 401 * </pre> 402 * 403 * <code>repeated string permissions = 1;</code> 404 * 405 * @param index The index of the value to return. 406 * @return The bytes of the permissions at the given index. 407 */ getPermissionsBytes(int index)408 public com.google.protobuf.ByteString getPermissionsBytes(int index) { 409 return permissions_.getByteString(index); 410 } 411 412 private byte memoizedIsInitialized = -1; 413 414 @java.lang.Override isInitialized()415 public final boolean isInitialized() { 416 byte isInitialized = memoizedIsInitialized; 417 if (isInitialized == 1) return true; 418 if (isInitialized == 0) return false; 419 420 memoizedIsInitialized = 1; 421 return true; 422 } 423 424 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)425 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 426 for (int i = 0; i < permissions_.size(); i++) { 427 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, permissions_.getRaw(i)); 428 } 429 getUnknownFields().writeTo(output); 430 } 431 432 @java.lang.Override getSerializedSize()433 public int getSerializedSize() { 434 int size = memoizedSize; 435 if (size != -1) return size; 436 437 size = 0; 438 { 439 int dataSize = 0; 440 for (int i = 0; i < permissions_.size(); i++) { 441 dataSize += computeStringSizeNoTag(permissions_.getRaw(i)); 442 } 443 size += dataSize; 444 size += 1 * getPermissionsList().size(); 445 } 446 size += getUnknownFields().getSerializedSize(); 447 memoizedSize = size; 448 return size; 449 } 450 451 @java.lang.Override equals(final java.lang.Object obj)452 public boolean equals(final java.lang.Object obj) { 453 if (obj == this) { 454 return true; 455 } 456 if (!(obj 457 instanceof com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions)) { 458 return super.equals(obj); 459 } 460 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions other = 461 (com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions) obj; 462 463 if (!getPermissionsList().equals(other.getPermissionsList())) return false; 464 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 465 return true; 466 } 467 468 @java.lang.Override hashCode()469 public int hashCode() { 470 if (memoizedHashCode != 0) { 471 return memoizedHashCode; 472 } 473 int hash = 41; 474 hash = (19 * hash) + getDescriptor().hashCode(); 475 if (getPermissionsCount() > 0) { 476 hash = (37 * hash) + PERMISSIONS_FIELD_NUMBER; 477 hash = (53 * hash) + getPermissionsList().hashCode(); 478 } 479 hash = (29 * hash) + getUnknownFields().hashCode(); 480 memoizedHashCode = hash; 481 return hash; 482 } 483 484 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions parseFrom(java.nio.ByteBuffer data)485 parseFrom(java.nio.ByteBuffer data) 486 throws com.google.protobuf.InvalidProtocolBufferException { 487 return PARSER.parseFrom(data); 488 } 489 490 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)491 parseFrom( 492 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 493 throws com.google.protobuf.InvalidProtocolBufferException { 494 return PARSER.parseFrom(data, extensionRegistry); 495 } 496 497 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions parseFrom(com.google.protobuf.ByteString data)498 parseFrom(com.google.protobuf.ByteString data) 499 throws com.google.protobuf.InvalidProtocolBufferException { 500 return PARSER.parseFrom(data); 501 } 502 503 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)504 parseFrom( 505 com.google.protobuf.ByteString data, 506 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 507 throws com.google.protobuf.InvalidProtocolBufferException { 508 return PARSER.parseFrom(data, extensionRegistry); 509 } 510 511 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions parseFrom(byte[] data)512 parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { 513 return PARSER.parseFrom(data); 514 } 515 516 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)517 parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 518 throws com.google.protobuf.InvalidProtocolBufferException { 519 return PARSER.parseFrom(data, extensionRegistry); 520 } 521 522 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions parseFrom(java.io.InputStream input)523 parseFrom(java.io.InputStream input) throws java.io.IOException { 524 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 525 } 526 527 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)528 parseFrom( 529 java.io.InputStream input, 530 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 531 throws java.io.IOException { 532 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 533 PARSER, input, extensionRegistry); 534 } 535 536 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions parseDelimitedFrom(java.io.InputStream input)537 parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { 538 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 539 } 540 541 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)542 parseDelimitedFrom( 543 java.io.InputStream input, 544 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 545 throws java.io.IOException { 546 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 547 PARSER, input, extensionRegistry); 548 } 549 550 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions parseFrom(com.google.protobuf.CodedInputStream input)551 parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { 552 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 553 } 554 555 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)556 parseFrom( 557 com.google.protobuf.CodedInputStream input, 558 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 559 throws java.io.IOException { 560 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 561 PARSER, input, extensionRegistry); 562 } 563 564 @java.lang.Override newBuilderForType()565 public Builder newBuilderForType() { 566 return newBuilder(); 567 } 568 newBuilder()569 public static Builder newBuilder() { 570 return DEFAULT_INSTANCE.toBuilder(); 571 } 572 newBuilder( com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions prototype)573 public static Builder newBuilder( 574 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions prototype) { 575 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 576 } 577 578 @java.lang.Override toBuilder()579 public Builder toBuilder() { 580 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 581 } 582 583 @java.lang.Override newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)584 protected Builder newBuilderForType( 585 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 586 Builder builder = new Builder(parent); 587 return builder; 588 } 589 /** 590 * 591 * 592 * <pre> 593 * IAM permissions 594 * </pre> 595 * 596 * Protobuf type {@code google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} 597 */ 598 public static final class Builder 599 extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 600 implements 601 // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions) 602 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.PermissionsOrBuilder { getDescriptor()603 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 604 return com.google.cloud.asset.v1.AssetProto 605 .internal_static_google_cloud_asset_v1_IamPolicySearchResult_Explanation_Permissions_descriptor; 606 } 607 608 @java.lang.Override 609 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()610 internalGetFieldAccessorTable() { 611 return com.google.cloud.asset.v1.AssetProto 612 .internal_static_google_cloud_asset_v1_IamPolicySearchResult_Explanation_Permissions_fieldAccessorTable 613 .ensureFieldAccessorsInitialized( 614 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.class, 615 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.Builder 616 .class); 617 } 618 619 // Construct using 620 // com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.newBuilder() Builder()621 private Builder() {} 622 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)623 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 624 super(parent); 625 } 626 627 @java.lang.Override clear()628 public Builder clear() { 629 super.clear(); 630 bitField0_ = 0; 631 permissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; 632 bitField0_ = (bitField0_ & ~0x00000001); 633 return this; 634 } 635 636 @java.lang.Override getDescriptorForType()637 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 638 return com.google.cloud.asset.v1.AssetProto 639 .internal_static_google_cloud_asset_v1_IamPolicySearchResult_Explanation_Permissions_descriptor; 640 } 641 642 @java.lang.Override 643 public com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions getDefaultInstanceForType()644 getDefaultInstanceForType() { 645 return com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions 646 .getDefaultInstance(); 647 } 648 649 @java.lang.Override build()650 public com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions build() { 651 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions result = 652 buildPartial(); 653 if (!result.isInitialized()) { 654 throw newUninitializedMessageException(result); 655 } 656 return result; 657 } 658 659 @java.lang.Override 660 public com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions buildPartial()661 buildPartial() { 662 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions result = 663 new com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions(this); 664 buildPartialRepeatedFields(result); 665 if (bitField0_ != 0) { 666 buildPartial0(result); 667 } 668 onBuilt(); 669 return result; 670 } 671 buildPartialRepeatedFields( com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions result)672 private void buildPartialRepeatedFields( 673 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions result) { 674 if (((bitField0_ & 0x00000001) != 0)) { 675 permissions_ = permissions_.getUnmodifiableView(); 676 bitField0_ = (bitField0_ & ~0x00000001); 677 } 678 result.permissions_ = permissions_; 679 } 680 buildPartial0( com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions result)681 private void buildPartial0( 682 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions result) { 683 int from_bitField0_ = bitField0_; 684 } 685 686 @java.lang.Override clone()687 public Builder clone() { 688 return super.clone(); 689 } 690 691 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)692 public Builder setField( 693 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 694 return super.setField(field, value); 695 } 696 697 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)698 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 699 return super.clearField(field); 700 } 701 702 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)703 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 704 return super.clearOneof(oneof); 705 } 706 707 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)708 public Builder setRepeatedField( 709 com.google.protobuf.Descriptors.FieldDescriptor field, 710 int index, 711 java.lang.Object value) { 712 return super.setRepeatedField(field, index, value); 713 } 714 715 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)716 public Builder addRepeatedField( 717 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 718 return super.addRepeatedField(field, value); 719 } 720 721 @java.lang.Override mergeFrom(com.google.protobuf.Message other)722 public Builder mergeFrom(com.google.protobuf.Message other) { 723 if (other 724 instanceof com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions) { 725 return mergeFrom( 726 (com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions) other); 727 } else { 728 super.mergeFrom(other); 729 return this; 730 } 731 } 732 mergeFrom( com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions other)733 public Builder mergeFrom( 734 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions other) { 735 if (other 736 == com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions 737 .getDefaultInstance()) return this; 738 if (!other.permissions_.isEmpty()) { 739 if (permissions_.isEmpty()) { 740 permissions_ = other.permissions_; 741 bitField0_ = (bitField0_ & ~0x00000001); 742 } else { 743 ensurePermissionsIsMutable(); 744 permissions_.addAll(other.permissions_); 745 } 746 onChanged(); 747 } 748 this.mergeUnknownFields(other.getUnknownFields()); 749 onChanged(); 750 return this; 751 } 752 753 @java.lang.Override isInitialized()754 public final boolean isInitialized() { 755 return true; 756 } 757 758 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)759 public Builder mergeFrom( 760 com.google.protobuf.CodedInputStream input, 761 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 762 throws java.io.IOException { 763 if (extensionRegistry == null) { 764 throw new java.lang.NullPointerException(); 765 } 766 try { 767 boolean done = false; 768 while (!done) { 769 int tag = input.readTag(); 770 switch (tag) { 771 case 0: 772 done = true; 773 break; 774 case 10: 775 { 776 java.lang.String s = input.readStringRequireUtf8(); 777 ensurePermissionsIsMutable(); 778 permissions_.add(s); 779 break; 780 } // case 10 781 default: 782 { 783 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 784 done = true; // was an endgroup tag 785 } 786 break; 787 } // default: 788 } // switch (tag) 789 } // while (!done) 790 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 791 throw e.unwrapIOException(); 792 } finally { 793 onChanged(); 794 } // finally 795 return this; 796 } 797 798 private int bitField0_; 799 800 private com.google.protobuf.LazyStringList permissions_ = 801 com.google.protobuf.LazyStringArrayList.EMPTY; 802 ensurePermissionsIsMutable()803 private void ensurePermissionsIsMutable() { 804 if (!((bitField0_ & 0x00000001) != 0)) { 805 permissions_ = new com.google.protobuf.LazyStringArrayList(permissions_); 806 bitField0_ |= 0x00000001; 807 } 808 } 809 /** 810 * 811 * 812 * <pre> 813 * A list of permissions. A sample permission string: `compute.disk.get`. 814 * </pre> 815 * 816 * <code>repeated string permissions = 1;</code> 817 * 818 * @return A list containing the permissions. 819 */ getPermissionsList()820 public com.google.protobuf.ProtocolStringList getPermissionsList() { 821 return permissions_.getUnmodifiableView(); 822 } 823 /** 824 * 825 * 826 * <pre> 827 * A list of permissions. A sample permission string: `compute.disk.get`. 828 * </pre> 829 * 830 * <code>repeated string permissions = 1;</code> 831 * 832 * @return The count of permissions. 833 */ getPermissionsCount()834 public int getPermissionsCount() { 835 return permissions_.size(); 836 } 837 /** 838 * 839 * 840 * <pre> 841 * A list of permissions. A sample permission string: `compute.disk.get`. 842 * </pre> 843 * 844 * <code>repeated string permissions = 1;</code> 845 * 846 * @param index The index of the element to return. 847 * @return The permissions at the given index. 848 */ getPermissions(int index)849 public java.lang.String getPermissions(int index) { 850 return permissions_.get(index); 851 } 852 /** 853 * 854 * 855 * <pre> 856 * A list of permissions. A sample permission string: `compute.disk.get`. 857 * </pre> 858 * 859 * <code>repeated string permissions = 1;</code> 860 * 861 * @param index The index of the value to return. 862 * @return The bytes of the permissions at the given index. 863 */ getPermissionsBytes(int index)864 public com.google.protobuf.ByteString getPermissionsBytes(int index) { 865 return permissions_.getByteString(index); 866 } 867 /** 868 * 869 * 870 * <pre> 871 * A list of permissions. A sample permission string: `compute.disk.get`. 872 * </pre> 873 * 874 * <code>repeated string permissions = 1;</code> 875 * 876 * @param index The index to set the value at. 877 * @param value The permissions to set. 878 * @return This builder for chaining. 879 */ setPermissions(int index, java.lang.String value)880 public Builder setPermissions(int index, java.lang.String value) { 881 if (value == null) { 882 throw new NullPointerException(); 883 } 884 ensurePermissionsIsMutable(); 885 permissions_.set(index, value); 886 onChanged(); 887 return this; 888 } 889 /** 890 * 891 * 892 * <pre> 893 * A list of permissions. A sample permission string: `compute.disk.get`. 894 * </pre> 895 * 896 * <code>repeated string permissions = 1;</code> 897 * 898 * @param value The permissions to add. 899 * @return This builder for chaining. 900 */ addPermissions(java.lang.String value)901 public Builder addPermissions(java.lang.String value) { 902 if (value == null) { 903 throw new NullPointerException(); 904 } 905 ensurePermissionsIsMutable(); 906 permissions_.add(value); 907 onChanged(); 908 return this; 909 } 910 /** 911 * 912 * 913 * <pre> 914 * A list of permissions. A sample permission string: `compute.disk.get`. 915 * </pre> 916 * 917 * <code>repeated string permissions = 1;</code> 918 * 919 * @param values The permissions to add. 920 * @return This builder for chaining. 921 */ addAllPermissions(java.lang.Iterable<java.lang.String> values)922 public Builder addAllPermissions(java.lang.Iterable<java.lang.String> values) { 923 ensurePermissionsIsMutable(); 924 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, permissions_); 925 onChanged(); 926 return this; 927 } 928 /** 929 * 930 * 931 * <pre> 932 * A list of permissions. A sample permission string: `compute.disk.get`. 933 * </pre> 934 * 935 * <code>repeated string permissions = 1;</code> 936 * 937 * @return This builder for chaining. 938 */ clearPermissions()939 public Builder clearPermissions() { 940 permissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; 941 bitField0_ = (bitField0_ & ~0x00000001); 942 onChanged(); 943 return this; 944 } 945 /** 946 * 947 * 948 * <pre> 949 * A list of permissions. A sample permission string: `compute.disk.get`. 950 * </pre> 951 * 952 * <code>repeated string permissions = 1;</code> 953 * 954 * @param value The bytes of the permissions to add. 955 * @return This builder for chaining. 956 */ addPermissionsBytes(com.google.protobuf.ByteString value)957 public Builder addPermissionsBytes(com.google.protobuf.ByteString value) { 958 if (value == null) { 959 throw new NullPointerException(); 960 } 961 checkByteStringIsUtf8(value); 962 ensurePermissionsIsMutable(); 963 permissions_.add(value); 964 onChanged(); 965 return this; 966 } 967 968 @java.lang.Override setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)969 public final Builder setUnknownFields( 970 final com.google.protobuf.UnknownFieldSet unknownFields) { 971 return super.setUnknownFields(unknownFields); 972 } 973 974 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)975 public final Builder mergeUnknownFields( 976 final com.google.protobuf.UnknownFieldSet unknownFields) { 977 return super.mergeUnknownFields(unknownFields); 978 } 979 980 // @@protoc_insertion_point(builder_scope:google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions) 981 } 982 983 // @@protoc_insertion_point(class_scope:google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions) 984 private static final com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions 985 DEFAULT_INSTANCE; 986 987 static { 988 DEFAULT_INSTANCE = 989 new com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions(); 990 } 991 992 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions getDefaultInstance()993 getDefaultInstance() { 994 return DEFAULT_INSTANCE; 995 } 996 997 private static final com.google.protobuf.Parser<Permissions> PARSER = 998 new com.google.protobuf.AbstractParser<Permissions>() { 999 @java.lang.Override 1000 public Permissions parsePartialFrom( 1001 com.google.protobuf.CodedInputStream input, 1002 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1003 throws com.google.protobuf.InvalidProtocolBufferException { 1004 Builder builder = newBuilder(); 1005 try { 1006 builder.mergeFrom(input, extensionRegistry); 1007 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1008 throw e.setUnfinishedMessage(builder.buildPartial()); 1009 } catch (com.google.protobuf.UninitializedMessageException e) { 1010 throw e.asInvalidProtocolBufferException() 1011 .setUnfinishedMessage(builder.buildPartial()); 1012 } catch (java.io.IOException e) { 1013 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1014 .setUnfinishedMessage(builder.buildPartial()); 1015 } 1016 return builder.buildPartial(); 1017 } 1018 }; 1019 parser()1020 public static com.google.protobuf.Parser<Permissions> parser() { 1021 return PARSER; 1022 } 1023 1024 @java.lang.Override getParserForType()1025 public com.google.protobuf.Parser<Permissions> getParserForType() { 1026 return PARSER; 1027 } 1028 1029 @java.lang.Override 1030 public com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions getDefaultInstanceForType()1031 getDefaultInstanceForType() { 1032 return DEFAULT_INSTANCE; 1033 } 1034 } 1035 1036 public static final int MATCHED_PERMISSIONS_FIELD_NUMBER = 1; 1037 1038 private static final class MatchedPermissionsDefaultEntryHolder { 1039 static final com.google.protobuf.MapEntry< 1040 java.lang.String, 1041 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> 1042 defaultEntry = 1043 com.google.protobuf.MapEntry 1044 .<java.lang.String, 1045 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> 1046 newDefaultInstance( 1047 com.google.cloud.asset.v1.AssetProto 1048 .internal_static_google_cloud_asset_v1_IamPolicySearchResult_Explanation_MatchedPermissionsEntry_descriptor, 1049 com.google.protobuf.WireFormat.FieldType.STRING, 1050 "", 1051 com.google.protobuf.WireFormat.FieldType.MESSAGE, 1052 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions 1053 .getDefaultInstance()); 1054 } 1055 1056 @SuppressWarnings("serial") 1057 private com.google.protobuf.MapField< 1058 java.lang.String, 1059 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> 1060 matchedPermissions_; 1061 1062 private com.google.protobuf.MapField< 1063 java.lang.String, 1064 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> internalGetMatchedPermissions()1065 internalGetMatchedPermissions() { 1066 if (matchedPermissions_ == null) { 1067 return com.google.protobuf.MapField.emptyMapField( 1068 MatchedPermissionsDefaultEntryHolder.defaultEntry); 1069 } 1070 return matchedPermissions_; 1071 } 1072 getMatchedPermissionsCount()1073 public int getMatchedPermissionsCount() { 1074 return internalGetMatchedPermissions().getMap().size(); 1075 } 1076 /** 1077 * 1078 * 1079 * <pre> 1080 * The map from roles to their included permissions that match the 1081 * permission query (i.e., a query containing `policy.role.permissions:`). 1082 * Example: if query `policy.role.permissions:compute.disk.get` 1083 * matches a policy binding that contains owner role, the 1084 * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The 1085 * roles can also be found in the returned `policy` bindings. Note that the 1086 * map is populated only for requests with permission queries. 1087 * </pre> 1088 * 1089 * <code> 1090 * map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1; 1091 * </code> 1092 */ 1093 @java.lang.Override containsMatchedPermissions(java.lang.String key)1094 public boolean containsMatchedPermissions(java.lang.String key) { 1095 if (key == null) { 1096 throw new NullPointerException("map key"); 1097 } 1098 return internalGetMatchedPermissions().getMap().containsKey(key); 1099 } 1100 /** Use {@link #getMatchedPermissionsMap()} instead. */ 1101 @java.lang.Override 1102 @java.lang.Deprecated 1103 public java.util.Map< 1104 java.lang.String, 1105 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> getMatchedPermissions()1106 getMatchedPermissions() { 1107 return getMatchedPermissionsMap(); 1108 } 1109 /** 1110 * 1111 * 1112 * <pre> 1113 * The map from roles to their included permissions that match the 1114 * permission query (i.e., a query containing `policy.role.permissions:`). 1115 * Example: if query `policy.role.permissions:compute.disk.get` 1116 * matches a policy binding that contains owner role, the 1117 * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The 1118 * roles can also be found in the returned `policy` bindings. Note that the 1119 * map is populated only for requests with permission queries. 1120 * </pre> 1121 * 1122 * <code> 1123 * map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1; 1124 * </code> 1125 */ 1126 @java.lang.Override 1127 public java.util.Map< 1128 java.lang.String, 1129 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> getMatchedPermissionsMap()1130 getMatchedPermissionsMap() { 1131 return internalGetMatchedPermissions().getMap(); 1132 } 1133 /** 1134 * 1135 * 1136 * <pre> 1137 * The map from roles to their included permissions that match the 1138 * permission query (i.e., a query containing `policy.role.permissions:`). 1139 * Example: if query `policy.role.permissions:compute.disk.get` 1140 * matches a policy binding that contains owner role, the 1141 * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The 1142 * roles can also be found in the returned `policy` bindings. Note that the 1143 * map is populated only for requests with permission queries. 1144 * </pre> 1145 * 1146 * <code> 1147 * map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1; 1148 * </code> 1149 */ 1150 @java.lang.Override 1151 public /* nullable */ com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions getMatchedPermissionsOrDefault( java.lang.String key, com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions defaultValue)1152 getMatchedPermissionsOrDefault( 1153 java.lang.String key, 1154 /* nullable */ 1155 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions defaultValue) { 1156 if (key == null) { 1157 throw new NullPointerException("map key"); 1158 } 1159 java.util.Map< 1160 java.lang.String, 1161 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> 1162 map = internalGetMatchedPermissions().getMap(); 1163 return map.containsKey(key) ? map.get(key) : defaultValue; 1164 } 1165 /** 1166 * 1167 * 1168 * <pre> 1169 * The map from roles to their included permissions that match the 1170 * permission query (i.e., a query containing `policy.role.permissions:`). 1171 * Example: if query `policy.role.permissions:compute.disk.get` 1172 * matches a policy binding that contains owner role, the 1173 * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The 1174 * roles can also be found in the returned `policy` bindings. Note that the 1175 * map is populated only for requests with permission queries. 1176 * </pre> 1177 * 1178 * <code> 1179 * map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1; 1180 * </code> 1181 */ 1182 @java.lang.Override 1183 public com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions getMatchedPermissionsOrThrow(java.lang.String key)1184 getMatchedPermissionsOrThrow(java.lang.String key) { 1185 if (key == null) { 1186 throw new NullPointerException("map key"); 1187 } 1188 java.util.Map< 1189 java.lang.String, 1190 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> 1191 map = internalGetMatchedPermissions().getMap(); 1192 if (!map.containsKey(key)) { 1193 throw new java.lang.IllegalArgumentException(); 1194 } 1195 return map.get(key); 1196 } 1197 1198 private byte memoizedIsInitialized = -1; 1199 1200 @java.lang.Override isInitialized()1201 public final boolean isInitialized() { 1202 byte isInitialized = memoizedIsInitialized; 1203 if (isInitialized == 1) return true; 1204 if (isInitialized == 0) return false; 1205 1206 memoizedIsInitialized = 1; 1207 return true; 1208 } 1209 1210 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)1211 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 1212 com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( 1213 output, 1214 internalGetMatchedPermissions(), 1215 MatchedPermissionsDefaultEntryHolder.defaultEntry, 1216 1); 1217 getUnknownFields().writeTo(output); 1218 } 1219 1220 @java.lang.Override getSerializedSize()1221 public int getSerializedSize() { 1222 int size = memoizedSize; 1223 if (size != -1) return size; 1224 1225 size = 0; 1226 for (java.util.Map.Entry< 1227 java.lang.String, 1228 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> 1229 entry : internalGetMatchedPermissions().getMap().entrySet()) { 1230 com.google.protobuf.MapEntry< 1231 java.lang.String, 1232 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> 1233 matchedPermissions__ = 1234 MatchedPermissionsDefaultEntryHolder.defaultEntry 1235 .newBuilderForType() 1236 .setKey(entry.getKey()) 1237 .setValue(entry.getValue()) 1238 .build(); 1239 size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, matchedPermissions__); 1240 } 1241 size += getUnknownFields().getSerializedSize(); 1242 memoizedSize = size; 1243 return size; 1244 } 1245 1246 @java.lang.Override equals(final java.lang.Object obj)1247 public boolean equals(final java.lang.Object obj) { 1248 if (obj == this) { 1249 return true; 1250 } 1251 if (!(obj instanceof com.google.cloud.asset.v1.IamPolicySearchResult.Explanation)) { 1252 return super.equals(obj); 1253 } 1254 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation other = 1255 (com.google.cloud.asset.v1.IamPolicySearchResult.Explanation) obj; 1256 1257 if (!internalGetMatchedPermissions().equals(other.internalGetMatchedPermissions())) 1258 return false; 1259 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 1260 return true; 1261 } 1262 1263 @java.lang.Override hashCode()1264 public int hashCode() { 1265 if (memoizedHashCode != 0) { 1266 return memoizedHashCode; 1267 } 1268 int hash = 41; 1269 hash = (19 * hash) + getDescriptor().hashCode(); 1270 if (!internalGetMatchedPermissions().getMap().isEmpty()) { 1271 hash = (37 * hash) + MATCHED_PERMISSIONS_FIELD_NUMBER; 1272 hash = (53 * hash) + internalGetMatchedPermissions().hashCode(); 1273 } 1274 hash = (29 * hash) + getUnknownFields().hashCode(); 1275 memoizedHashCode = hash; 1276 return hash; 1277 } 1278 parseFrom( java.nio.ByteBuffer data)1279 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation parseFrom( 1280 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 1281 return PARSER.parseFrom(data); 1282 } 1283 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1284 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation parseFrom( 1285 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1286 throws com.google.protobuf.InvalidProtocolBufferException { 1287 return PARSER.parseFrom(data, extensionRegistry); 1288 } 1289 parseFrom( com.google.protobuf.ByteString data)1290 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation parseFrom( 1291 com.google.protobuf.ByteString data) 1292 throws com.google.protobuf.InvalidProtocolBufferException { 1293 return PARSER.parseFrom(data); 1294 } 1295 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1296 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation parseFrom( 1297 com.google.protobuf.ByteString data, 1298 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1299 throws com.google.protobuf.InvalidProtocolBufferException { 1300 return PARSER.parseFrom(data, extensionRegistry); 1301 } 1302 parseFrom(byte[] data)1303 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation parseFrom(byte[] data) 1304 throws com.google.protobuf.InvalidProtocolBufferException { 1305 return PARSER.parseFrom(data); 1306 } 1307 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1308 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation parseFrom( 1309 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1310 throws com.google.protobuf.InvalidProtocolBufferException { 1311 return PARSER.parseFrom(data, extensionRegistry); 1312 } 1313 parseFrom( java.io.InputStream input)1314 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation parseFrom( 1315 java.io.InputStream input) throws java.io.IOException { 1316 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1317 } 1318 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1319 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation parseFrom( 1320 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1321 throws java.io.IOException { 1322 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1323 PARSER, input, extensionRegistry); 1324 } 1325 parseDelimitedFrom( java.io.InputStream input)1326 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation parseDelimitedFrom( 1327 java.io.InputStream input) throws java.io.IOException { 1328 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 1329 } 1330 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1331 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation parseDelimitedFrom( 1332 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1333 throws java.io.IOException { 1334 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 1335 PARSER, input, extensionRegistry); 1336 } 1337 parseFrom( com.google.protobuf.CodedInputStream input)1338 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation parseFrom( 1339 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 1340 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1341 } 1342 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1343 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation parseFrom( 1344 com.google.protobuf.CodedInputStream input, 1345 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1346 throws java.io.IOException { 1347 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1348 PARSER, input, extensionRegistry); 1349 } 1350 1351 @java.lang.Override newBuilderForType()1352 public Builder newBuilderForType() { 1353 return newBuilder(); 1354 } 1355 newBuilder()1356 public static Builder newBuilder() { 1357 return DEFAULT_INSTANCE.toBuilder(); 1358 } 1359 newBuilder( com.google.cloud.asset.v1.IamPolicySearchResult.Explanation prototype)1360 public static Builder newBuilder( 1361 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation prototype) { 1362 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 1363 } 1364 1365 @java.lang.Override toBuilder()1366 public Builder toBuilder() { 1367 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 1368 } 1369 1370 @java.lang.Override newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1371 protected Builder newBuilderForType( 1372 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1373 Builder builder = new Builder(parent); 1374 return builder; 1375 } 1376 /** 1377 * 1378 * 1379 * <pre> 1380 * Explanation about the IAM policy search result. 1381 * </pre> 1382 * 1383 * Protobuf type {@code google.cloud.asset.v1.IamPolicySearchResult.Explanation} 1384 */ 1385 public static final class Builder 1386 extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 1387 implements 1388 // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1.IamPolicySearchResult.Explanation) 1389 com.google.cloud.asset.v1.IamPolicySearchResult.ExplanationOrBuilder { getDescriptor()1390 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 1391 return com.google.cloud.asset.v1.AssetProto 1392 .internal_static_google_cloud_asset_v1_IamPolicySearchResult_Explanation_descriptor; 1393 } 1394 1395 @SuppressWarnings({"rawtypes"}) internalGetMapField(int number)1396 protected com.google.protobuf.MapField internalGetMapField(int number) { 1397 switch (number) { 1398 case 1: 1399 return internalGetMatchedPermissions(); 1400 default: 1401 throw new RuntimeException("Invalid map field number: " + number); 1402 } 1403 } 1404 1405 @SuppressWarnings({"rawtypes"}) internalGetMutableMapField(int number)1406 protected com.google.protobuf.MapField internalGetMutableMapField(int number) { 1407 switch (number) { 1408 case 1: 1409 return internalGetMutableMatchedPermissions(); 1410 default: 1411 throw new RuntimeException("Invalid map field number: " + number); 1412 } 1413 } 1414 1415 @java.lang.Override 1416 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()1417 internalGetFieldAccessorTable() { 1418 return com.google.cloud.asset.v1.AssetProto 1419 .internal_static_google_cloud_asset_v1_IamPolicySearchResult_Explanation_fieldAccessorTable 1420 .ensureFieldAccessorsInitialized( 1421 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.class, 1422 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Builder.class); 1423 } 1424 1425 // Construct using com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.newBuilder() Builder()1426 private Builder() {} 1427 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1428 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1429 super(parent); 1430 } 1431 1432 @java.lang.Override clear()1433 public Builder clear() { 1434 super.clear(); 1435 bitField0_ = 0; 1436 internalGetMutableMatchedPermissions().clear(); 1437 return this; 1438 } 1439 1440 @java.lang.Override getDescriptorForType()1441 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 1442 return com.google.cloud.asset.v1.AssetProto 1443 .internal_static_google_cloud_asset_v1_IamPolicySearchResult_Explanation_descriptor; 1444 } 1445 1446 @java.lang.Override 1447 public com.google.cloud.asset.v1.IamPolicySearchResult.Explanation getDefaultInstanceForType()1448 getDefaultInstanceForType() { 1449 return com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.getDefaultInstance(); 1450 } 1451 1452 @java.lang.Override build()1453 public com.google.cloud.asset.v1.IamPolicySearchResult.Explanation build() { 1454 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation result = buildPartial(); 1455 if (!result.isInitialized()) { 1456 throw newUninitializedMessageException(result); 1457 } 1458 return result; 1459 } 1460 1461 @java.lang.Override buildPartial()1462 public com.google.cloud.asset.v1.IamPolicySearchResult.Explanation buildPartial() { 1463 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation result = 1464 new com.google.cloud.asset.v1.IamPolicySearchResult.Explanation(this); 1465 if (bitField0_ != 0) { 1466 buildPartial0(result); 1467 } 1468 onBuilt(); 1469 return result; 1470 } 1471 buildPartial0( com.google.cloud.asset.v1.IamPolicySearchResult.Explanation result)1472 private void buildPartial0( 1473 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation result) { 1474 int from_bitField0_ = bitField0_; 1475 if (((from_bitField0_ & 0x00000001) != 0)) { 1476 result.matchedPermissions_ = internalGetMatchedPermissions(); 1477 result.matchedPermissions_.makeImmutable(); 1478 } 1479 } 1480 1481 @java.lang.Override clone()1482 public Builder clone() { 1483 return super.clone(); 1484 } 1485 1486 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1487 public Builder setField( 1488 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1489 return super.setField(field, value); 1490 } 1491 1492 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1493 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 1494 return super.clearField(field); 1495 } 1496 1497 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1498 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 1499 return super.clearOneof(oneof); 1500 } 1501 1502 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1503 public Builder setRepeatedField( 1504 com.google.protobuf.Descriptors.FieldDescriptor field, 1505 int index, 1506 java.lang.Object value) { 1507 return super.setRepeatedField(field, index, value); 1508 } 1509 1510 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1511 public Builder addRepeatedField( 1512 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1513 return super.addRepeatedField(field, value); 1514 } 1515 1516 @java.lang.Override mergeFrom(com.google.protobuf.Message other)1517 public Builder mergeFrom(com.google.protobuf.Message other) { 1518 if (other instanceof com.google.cloud.asset.v1.IamPolicySearchResult.Explanation) { 1519 return mergeFrom((com.google.cloud.asset.v1.IamPolicySearchResult.Explanation) other); 1520 } else { 1521 super.mergeFrom(other); 1522 return this; 1523 } 1524 } 1525 mergeFrom(com.google.cloud.asset.v1.IamPolicySearchResult.Explanation other)1526 public Builder mergeFrom(com.google.cloud.asset.v1.IamPolicySearchResult.Explanation other) { 1527 if (other 1528 == com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.getDefaultInstance()) 1529 return this; 1530 internalGetMutableMatchedPermissions().mergeFrom(other.internalGetMatchedPermissions()); 1531 bitField0_ |= 0x00000001; 1532 this.mergeUnknownFields(other.getUnknownFields()); 1533 onChanged(); 1534 return this; 1535 } 1536 1537 @java.lang.Override isInitialized()1538 public final boolean isInitialized() { 1539 return true; 1540 } 1541 1542 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1543 public Builder mergeFrom( 1544 com.google.protobuf.CodedInputStream input, 1545 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1546 throws java.io.IOException { 1547 if (extensionRegistry == null) { 1548 throw new java.lang.NullPointerException(); 1549 } 1550 try { 1551 boolean done = false; 1552 while (!done) { 1553 int tag = input.readTag(); 1554 switch (tag) { 1555 case 0: 1556 done = true; 1557 break; 1558 case 10: 1559 { 1560 com.google.protobuf.MapEntry< 1561 java.lang.String, 1562 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> 1563 matchedPermissions__ = 1564 input.readMessage( 1565 MatchedPermissionsDefaultEntryHolder.defaultEntry.getParserForType(), 1566 extensionRegistry); 1567 internalGetMutableMatchedPermissions() 1568 .getMutableMap() 1569 .put(matchedPermissions__.getKey(), matchedPermissions__.getValue()); 1570 bitField0_ |= 0x00000001; 1571 break; 1572 } // case 10 1573 default: 1574 { 1575 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 1576 done = true; // was an endgroup tag 1577 } 1578 break; 1579 } // default: 1580 } // switch (tag) 1581 } // while (!done) 1582 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1583 throw e.unwrapIOException(); 1584 } finally { 1585 onChanged(); 1586 } // finally 1587 return this; 1588 } 1589 1590 private int bitField0_; 1591 1592 private com.google.protobuf.MapField< 1593 java.lang.String, 1594 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> 1595 matchedPermissions_; 1596 1597 private com.google.protobuf.MapField< 1598 java.lang.String, 1599 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> internalGetMatchedPermissions()1600 internalGetMatchedPermissions() { 1601 if (matchedPermissions_ == null) { 1602 return com.google.protobuf.MapField.emptyMapField( 1603 MatchedPermissionsDefaultEntryHolder.defaultEntry); 1604 } 1605 return matchedPermissions_; 1606 } 1607 1608 private com.google.protobuf.MapField< 1609 java.lang.String, 1610 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> internalGetMutableMatchedPermissions()1611 internalGetMutableMatchedPermissions() { 1612 if (matchedPermissions_ == null) { 1613 matchedPermissions_ = 1614 com.google.protobuf.MapField.newMapField( 1615 MatchedPermissionsDefaultEntryHolder.defaultEntry); 1616 } 1617 if (!matchedPermissions_.isMutable()) { 1618 matchedPermissions_ = matchedPermissions_.copy(); 1619 } 1620 bitField0_ |= 0x00000001; 1621 onChanged(); 1622 return matchedPermissions_; 1623 } 1624 getMatchedPermissionsCount()1625 public int getMatchedPermissionsCount() { 1626 return internalGetMatchedPermissions().getMap().size(); 1627 } 1628 /** 1629 * 1630 * 1631 * <pre> 1632 * The map from roles to their included permissions that match the 1633 * permission query (i.e., a query containing `policy.role.permissions:`). 1634 * Example: if query `policy.role.permissions:compute.disk.get` 1635 * matches a policy binding that contains owner role, the 1636 * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The 1637 * roles can also be found in the returned `policy` bindings. Note that the 1638 * map is populated only for requests with permission queries. 1639 * </pre> 1640 * 1641 * <code> 1642 * map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1; 1643 * </code> 1644 */ 1645 @java.lang.Override containsMatchedPermissions(java.lang.String key)1646 public boolean containsMatchedPermissions(java.lang.String key) { 1647 if (key == null) { 1648 throw new NullPointerException("map key"); 1649 } 1650 return internalGetMatchedPermissions().getMap().containsKey(key); 1651 } 1652 /** Use {@link #getMatchedPermissionsMap()} instead. */ 1653 @java.lang.Override 1654 @java.lang.Deprecated 1655 public java.util.Map< 1656 java.lang.String, 1657 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> getMatchedPermissions()1658 getMatchedPermissions() { 1659 return getMatchedPermissionsMap(); 1660 } 1661 /** 1662 * 1663 * 1664 * <pre> 1665 * The map from roles to their included permissions that match the 1666 * permission query (i.e., a query containing `policy.role.permissions:`). 1667 * Example: if query `policy.role.permissions:compute.disk.get` 1668 * matches a policy binding that contains owner role, the 1669 * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The 1670 * roles can also be found in the returned `policy` bindings. Note that the 1671 * map is populated only for requests with permission queries. 1672 * </pre> 1673 * 1674 * <code> 1675 * map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1; 1676 * </code> 1677 */ 1678 @java.lang.Override 1679 public java.util.Map< 1680 java.lang.String, 1681 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> getMatchedPermissionsMap()1682 getMatchedPermissionsMap() { 1683 return internalGetMatchedPermissions().getMap(); 1684 } 1685 /** 1686 * 1687 * 1688 * <pre> 1689 * The map from roles to their included permissions that match the 1690 * permission query (i.e., a query containing `policy.role.permissions:`). 1691 * Example: if query `policy.role.permissions:compute.disk.get` 1692 * matches a policy binding that contains owner role, the 1693 * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The 1694 * roles can also be found in the returned `policy` bindings. Note that the 1695 * map is populated only for requests with permission queries. 1696 * </pre> 1697 * 1698 * <code> 1699 * map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1; 1700 * </code> 1701 */ 1702 @java.lang.Override 1703 public /* nullable */ com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions getMatchedPermissionsOrDefault( java.lang.String key, com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions defaultValue)1704 getMatchedPermissionsOrDefault( 1705 java.lang.String key, 1706 /* nullable */ 1707 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions 1708 defaultValue) { 1709 if (key == null) { 1710 throw new NullPointerException("map key"); 1711 } 1712 java.util.Map< 1713 java.lang.String, 1714 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> 1715 map = internalGetMatchedPermissions().getMap(); 1716 return map.containsKey(key) ? map.get(key) : defaultValue; 1717 } 1718 /** 1719 * 1720 * 1721 * <pre> 1722 * The map from roles to their included permissions that match the 1723 * permission query (i.e., a query containing `policy.role.permissions:`). 1724 * Example: if query `policy.role.permissions:compute.disk.get` 1725 * matches a policy binding that contains owner role, the 1726 * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The 1727 * roles can also be found in the returned `policy` bindings. Note that the 1728 * map is populated only for requests with permission queries. 1729 * </pre> 1730 * 1731 * <code> 1732 * map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1; 1733 * </code> 1734 */ 1735 @java.lang.Override 1736 public com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions getMatchedPermissionsOrThrow(java.lang.String key)1737 getMatchedPermissionsOrThrow(java.lang.String key) { 1738 if (key == null) { 1739 throw new NullPointerException("map key"); 1740 } 1741 java.util.Map< 1742 java.lang.String, 1743 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> 1744 map = internalGetMatchedPermissions().getMap(); 1745 if (!map.containsKey(key)) { 1746 throw new java.lang.IllegalArgumentException(); 1747 } 1748 return map.get(key); 1749 } 1750 clearMatchedPermissions()1751 public Builder clearMatchedPermissions() { 1752 bitField0_ = (bitField0_ & ~0x00000001); 1753 internalGetMutableMatchedPermissions().getMutableMap().clear(); 1754 return this; 1755 } 1756 /** 1757 * 1758 * 1759 * <pre> 1760 * The map from roles to their included permissions that match the 1761 * permission query (i.e., a query containing `policy.role.permissions:`). 1762 * Example: if query `policy.role.permissions:compute.disk.get` 1763 * matches a policy binding that contains owner role, the 1764 * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The 1765 * roles can also be found in the returned `policy` bindings. Note that the 1766 * map is populated only for requests with permission queries. 1767 * </pre> 1768 * 1769 * <code> 1770 * map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1; 1771 * </code> 1772 */ removeMatchedPermissions(java.lang.String key)1773 public Builder removeMatchedPermissions(java.lang.String key) { 1774 if (key == null) { 1775 throw new NullPointerException("map key"); 1776 } 1777 internalGetMutableMatchedPermissions().getMutableMap().remove(key); 1778 return this; 1779 } 1780 /** Use alternate mutation accessors instead. */ 1781 @java.lang.Deprecated 1782 public java.util.Map< 1783 java.lang.String, 1784 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> getMutableMatchedPermissions()1785 getMutableMatchedPermissions() { 1786 bitField0_ |= 0x00000001; 1787 return internalGetMutableMatchedPermissions().getMutableMap(); 1788 } 1789 /** 1790 * 1791 * 1792 * <pre> 1793 * The map from roles to their included permissions that match the 1794 * permission query (i.e., a query containing `policy.role.permissions:`). 1795 * Example: if query `policy.role.permissions:compute.disk.get` 1796 * matches a policy binding that contains owner role, the 1797 * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The 1798 * roles can also be found in the returned `policy` bindings. Note that the 1799 * map is populated only for requests with permission queries. 1800 * </pre> 1801 * 1802 * <code> 1803 * map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1; 1804 * </code> 1805 */ putMatchedPermissions( java.lang.String key, com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions value)1806 public Builder putMatchedPermissions( 1807 java.lang.String key, 1808 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions value) { 1809 if (key == null) { 1810 throw new NullPointerException("map key"); 1811 } 1812 if (value == null) { 1813 throw new NullPointerException("map value"); 1814 } 1815 internalGetMutableMatchedPermissions().getMutableMap().put(key, value); 1816 bitField0_ |= 0x00000001; 1817 return this; 1818 } 1819 /** 1820 * 1821 * 1822 * <pre> 1823 * The map from roles to their included permissions that match the 1824 * permission query (i.e., a query containing `policy.role.permissions:`). 1825 * Example: if query `policy.role.permissions:compute.disk.get` 1826 * matches a policy binding that contains owner role, the 1827 * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The 1828 * roles can also be found in the returned `policy` bindings. Note that the 1829 * map is populated only for requests with permission queries. 1830 * </pre> 1831 * 1832 * <code> 1833 * map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1; 1834 * </code> 1835 */ putAllMatchedPermissions( java.util.Map< java.lang.String, com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> values)1836 public Builder putAllMatchedPermissions( 1837 java.util.Map< 1838 java.lang.String, 1839 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> 1840 values) { 1841 internalGetMutableMatchedPermissions().getMutableMap().putAll(values); 1842 bitField0_ |= 0x00000001; 1843 return this; 1844 } 1845 1846 @java.lang.Override setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1847 public final Builder setUnknownFields( 1848 final com.google.protobuf.UnknownFieldSet unknownFields) { 1849 return super.setUnknownFields(unknownFields); 1850 } 1851 1852 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1853 public final Builder mergeUnknownFields( 1854 final com.google.protobuf.UnknownFieldSet unknownFields) { 1855 return super.mergeUnknownFields(unknownFields); 1856 } 1857 1858 // @@protoc_insertion_point(builder_scope:google.cloud.asset.v1.IamPolicySearchResult.Explanation) 1859 } 1860 1861 // @@protoc_insertion_point(class_scope:google.cloud.asset.v1.IamPolicySearchResult.Explanation) 1862 private static final com.google.cloud.asset.v1.IamPolicySearchResult.Explanation 1863 DEFAULT_INSTANCE; 1864 1865 static { 1866 DEFAULT_INSTANCE = new com.google.cloud.asset.v1.IamPolicySearchResult.Explanation(); 1867 } 1868 getDefaultInstance()1869 public static com.google.cloud.asset.v1.IamPolicySearchResult.Explanation getDefaultInstance() { 1870 return DEFAULT_INSTANCE; 1871 } 1872 1873 private static final com.google.protobuf.Parser<Explanation> PARSER = 1874 new com.google.protobuf.AbstractParser<Explanation>() { 1875 @java.lang.Override 1876 public Explanation parsePartialFrom( 1877 com.google.protobuf.CodedInputStream input, 1878 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1879 throws com.google.protobuf.InvalidProtocolBufferException { 1880 Builder builder = newBuilder(); 1881 try { 1882 builder.mergeFrom(input, extensionRegistry); 1883 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1884 throw e.setUnfinishedMessage(builder.buildPartial()); 1885 } catch (com.google.protobuf.UninitializedMessageException e) { 1886 throw e.asInvalidProtocolBufferException() 1887 .setUnfinishedMessage(builder.buildPartial()); 1888 } catch (java.io.IOException e) { 1889 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1890 .setUnfinishedMessage(builder.buildPartial()); 1891 } 1892 return builder.buildPartial(); 1893 } 1894 }; 1895 parser()1896 public static com.google.protobuf.Parser<Explanation> parser() { 1897 return PARSER; 1898 } 1899 1900 @java.lang.Override getParserForType()1901 public com.google.protobuf.Parser<Explanation> getParserForType() { 1902 return PARSER; 1903 } 1904 1905 @java.lang.Override getDefaultInstanceForType()1906 public com.google.cloud.asset.v1.IamPolicySearchResult.Explanation getDefaultInstanceForType() { 1907 return DEFAULT_INSTANCE; 1908 } 1909 } 1910 1911 public static final int RESOURCE_FIELD_NUMBER = 1; 1912 1913 @SuppressWarnings("serial") 1914 private volatile java.lang.Object resource_ = ""; 1915 /** 1916 * 1917 * 1918 * <pre> 1919 * The full resource name of the resource associated with this IAM policy. 1920 * Example: 1921 * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. 1922 * See [Cloud Asset Inventory Resource Name 1923 * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) 1924 * for more information. 1925 * To search against the `resource`: 1926 * * use a field query. Example: `resource:organizations/123` 1927 * </pre> 1928 * 1929 * <code>string resource = 1;</code> 1930 * 1931 * @return The resource. 1932 */ 1933 @java.lang.Override getResource()1934 public java.lang.String getResource() { 1935 java.lang.Object ref = resource_; 1936 if (ref instanceof java.lang.String) { 1937 return (java.lang.String) ref; 1938 } else { 1939 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1940 java.lang.String s = bs.toStringUtf8(); 1941 resource_ = s; 1942 return s; 1943 } 1944 } 1945 /** 1946 * 1947 * 1948 * <pre> 1949 * The full resource name of the resource associated with this IAM policy. 1950 * Example: 1951 * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. 1952 * See [Cloud Asset Inventory Resource Name 1953 * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) 1954 * for more information. 1955 * To search against the `resource`: 1956 * * use a field query. Example: `resource:organizations/123` 1957 * </pre> 1958 * 1959 * <code>string resource = 1;</code> 1960 * 1961 * @return The bytes for resource. 1962 */ 1963 @java.lang.Override getResourceBytes()1964 public com.google.protobuf.ByteString getResourceBytes() { 1965 java.lang.Object ref = resource_; 1966 if (ref instanceof java.lang.String) { 1967 com.google.protobuf.ByteString b = 1968 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1969 resource_ = b; 1970 return b; 1971 } else { 1972 return (com.google.protobuf.ByteString) ref; 1973 } 1974 } 1975 1976 public static final int ASSET_TYPE_FIELD_NUMBER = 5; 1977 1978 @SuppressWarnings("serial") 1979 private volatile java.lang.Object assetType_ = ""; 1980 /** 1981 * 1982 * 1983 * <pre> 1984 * The type of the resource associated with this IAM policy. Example: 1985 * `compute.googleapis.com/Disk`. 1986 * To search against the `asset_type`: 1987 * * specify the `asset_types` field in your search request. 1988 * </pre> 1989 * 1990 * <code>string asset_type = 5;</code> 1991 * 1992 * @return The assetType. 1993 */ 1994 @java.lang.Override getAssetType()1995 public java.lang.String getAssetType() { 1996 java.lang.Object ref = assetType_; 1997 if (ref instanceof java.lang.String) { 1998 return (java.lang.String) ref; 1999 } else { 2000 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2001 java.lang.String s = bs.toStringUtf8(); 2002 assetType_ = s; 2003 return s; 2004 } 2005 } 2006 /** 2007 * 2008 * 2009 * <pre> 2010 * The type of the resource associated with this IAM policy. Example: 2011 * `compute.googleapis.com/Disk`. 2012 * To search against the `asset_type`: 2013 * * specify the `asset_types` field in your search request. 2014 * </pre> 2015 * 2016 * <code>string asset_type = 5;</code> 2017 * 2018 * @return The bytes for assetType. 2019 */ 2020 @java.lang.Override getAssetTypeBytes()2021 public com.google.protobuf.ByteString getAssetTypeBytes() { 2022 java.lang.Object ref = assetType_; 2023 if (ref instanceof java.lang.String) { 2024 com.google.protobuf.ByteString b = 2025 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2026 assetType_ = b; 2027 return b; 2028 } else { 2029 return (com.google.protobuf.ByteString) ref; 2030 } 2031 } 2032 2033 public static final int PROJECT_FIELD_NUMBER = 2; 2034 2035 @SuppressWarnings("serial") 2036 private volatile java.lang.Object project_ = ""; 2037 /** 2038 * 2039 * 2040 * <pre> 2041 * The project that the associated Google Cloud resource belongs to, in the 2042 * form of projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource 2043 * (like VM instance, Cloud Storage bucket), the project field will indicate 2044 * the project that contains the resource. If an IAM policy is set on a folder 2045 * or orgnization, this field will be empty. 2046 * To search against the `project`: 2047 * * specify the `scope` field as this project in your search request. 2048 * </pre> 2049 * 2050 * <code>string project = 2;</code> 2051 * 2052 * @return The project. 2053 */ 2054 @java.lang.Override getProject()2055 public java.lang.String getProject() { 2056 java.lang.Object ref = project_; 2057 if (ref instanceof java.lang.String) { 2058 return (java.lang.String) ref; 2059 } else { 2060 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2061 java.lang.String s = bs.toStringUtf8(); 2062 project_ = s; 2063 return s; 2064 } 2065 } 2066 /** 2067 * 2068 * 2069 * <pre> 2070 * The project that the associated Google Cloud resource belongs to, in the 2071 * form of projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource 2072 * (like VM instance, Cloud Storage bucket), the project field will indicate 2073 * the project that contains the resource. If an IAM policy is set on a folder 2074 * or orgnization, this field will be empty. 2075 * To search against the `project`: 2076 * * specify the `scope` field as this project in your search request. 2077 * </pre> 2078 * 2079 * <code>string project = 2;</code> 2080 * 2081 * @return The bytes for project. 2082 */ 2083 @java.lang.Override getProjectBytes()2084 public com.google.protobuf.ByteString getProjectBytes() { 2085 java.lang.Object ref = project_; 2086 if (ref instanceof java.lang.String) { 2087 com.google.protobuf.ByteString b = 2088 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2089 project_ = b; 2090 return b; 2091 } else { 2092 return (com.google.protobuf.ByteString) ref; 2093 } 2094 } 2095 2096 public static final int FOLDERS_FIELD_NUMBER = 6; 2097 2098 @SuppressWarnings("serial") 2099 private com.google.protobuf.LazyStringList folders_; 2100 /** 2101 * 2102 * 2103 * <pre> 2104 * The folder(s) that the IAM policy belongs to, in the form of 2105 * folders/{FOLDER_NUMBER}. This field is available when the IAM policy 2106 * belongs to one or more folders. 2107 * To search against `folders`: 2108 * * use a field query. Example: `folders:(123 OR 456)` 2109 * * use a free text query. Example: `123` 2110 * * specify the `scope` field as this folder in your search request. 2111 * </pre> 2112 * 2113 * <code>repeated string folders = 6;</code> 2114 * 2115 * @return A list containing the folders. 2116 */ getFoldersList()2117 public com.google.protobuf.ProtocolStringList getFoldersList() { 2118 return folders_; 2119 } 2120 /** 2121 * 2122 * 2123 * <pre> 2124 * The folder(s) that the IAM policy belongs to, in the form of 2125 * folders/{FOLDER_NUMBER}. This field is available when the IAM policy 2126 * belongs to one or more folders. 2127 * To search against `folders`: 2128 * * use a field query. Example: `folders:(123 OR 456)` 2129 * * use a free text query. Example: `123` 2130 * * specify the `scope` field as this folder in your search request. 2131 * </pre> 2132 * 2133 * <code>repeated string folders = 6;</code> 2134 * 2135 * @return The count of folders. 2136 */ getFoldersCount()2137 public int getFoldersCount() { 2138 return folders_.size(); 2139 } 2140 /** 2141 * 2142 * 2143 * <pre> 2144 * The folder(s) that the IAM policy belongs to, in the form of 2145 * folders/{FOLDER_NUMBER}. This field is available when the IAM policy 2146 * belongs to one or more folders. 2147 * To search against `folders`: 2148 * * use a field query. Example: `folders:(123 OR 456)` 2149 * * use a free text query. Example: `123` 2150 * * specify the `scope` field as this folder in your search request. 2151 * </pre> 2152 * 2153 * <code>repeated string folders = 6;</code> 2154 * 2155 * @param index The index of the element to return. 2156 * @return The folders at the given index. 2157 */ getFolders(int index)2158 public java.lang.String getFolders(int index) { 2159 return folders_.get(index); 2160 } 2161 /** 2162 * 2163 * 2164 * <pre> 2165 * The folder(s) that the IAM policy belongs to, in the form of 2166 * folders/{FOLDER_NUMBER}. This field is available when the IAM policy 2167 * belongs to one or more folders. 2168 * To search against `folders`: 2169 * * use a field query. Example: `folders:(123 OR 456)` 2170 * * use a free text query. Example: `123` 2171 * * specify the `scope` field as this folder in your search request. 2172 * </pre> 2173 * 2174 * <code>repeated string folders = 6;</code> 2175 * 2176 * @param index The index of the value to return. 2177 * @return The bytes of the folders at the given index. 2178 */ getFoldersBytes(int index)2179 public com.google.protobuf.ByteString getFoldersBytes(int index) { 2180 return folders_.getByteString(index); 2181 } 2182 2183 public static final int ORGANIZATION_FIELD_NUMBER = 7; 2184 2185 @SuppressWarnings("serial") 2186 private volatile java.lang.Object organization_ = ""; 2187 /** 2188 * 2189 * 2190 * <pre> 2191 * The organization that the IAM policy belongs to, in the form 2192 * of organizations/{ORGANIZATION_NUMBER}. This field is available when the 2193 * IAM policy belongs to an organization. 2194 * To search against `organization`: 2195 * * use a field query. Example: `organization:123` 2196 * * use a free text query. Example: `123` 2197 * * specify the `scope` field as this organization in your search request. 2198 * </pre> 2199 * 2200 * <code>string organization = 7;</code> 2201 * 2202 * @return The organization. 2203 */ 2204 @java.lang.Override getOrganization()2205 public java.lang.String getOrganization() { 2206 java.lang.Object ref = organization_; 2207 if (ref instanceof java.lang.String) { 2208 return (java.lang.String) ref; 2209 } else { 2210 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2211 java.lang.String s = bs.toStringUtf8(); 2212 organization_ = s; 2213 return s; 2214 } 2215 } 2216 /** 2217 * 2218 * 2219 * <pre> 2220 * The organization that the IAM policy belongs to, in the form 2221 * of organizations/{ORGANIZATION_NUMBER}. This field is available when the 2222 * IAM policy belongs to an organization. 2223 * To search against `organization`: 2224 * * use a field query. Example: `organization:123` 2225 * * use a free text query. Example: `123` 2226 * * specify the `scope` field as this organization in your search request. 2227 * </pre> 2228 * 2229 * <code>string organization = 7;</code> 2230 * 2231 * @return The bytes for organization. 2232 */ 2233 @java.lang.Override getOrganizationBytes()2234 public com.google.protobuf.ByteString getOrganizationBytes() { 2235 java.lang.Object ref = organization_; 2236 if (ref instanceof java.lang.String) { 2237 com.google.protobuf.ByteString b = 2238 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2239 organization_ = b; 2240 return b; 2241 } else { 2242 return (com.google.protobuf.ByteString) ref; 2243 } 2244 } 2245 2246 public static final int POLICY_FIELD_NUMBER = 3; 2247 private com.google.iam.v1.Policy policy_; 2248 /** 2249 * 2250 * 2251 * <pre> 2252 * The IAM policy directly set on the given resource. Note that the original 2253 * IAM policy can contain multiple bindings. This only contains the bindings 2254 * that match the given query. For queries that don't contain a constrain on 2255 * policies (e.g., an empty query), this contains all the bindings. 2256 * To search against the `policy` bindings: 2257 * * use a field query: 2258 * - query by the policy contained members. Example: 2259 * `policy:amy@gmail.com` 2260 * - query by the policy contained roles. Example: 2261 * `policy:roles/compute.admin` 2262 * - query by the policy contained roles' included permissions. Example: 2263 * `policy.role.permissions:compute.instances.create` 2264 * </pre> 2265 * 2266 * <code>.google.iam.v1.Policy policy = 3;</code> 2267 * 2268 * @return Whether the policy field is set. 2269 */ 2270 @java.lang.Override hasPolicy()2271 public boolean hasPolicy() { 2272 return policy_ != null; 2273 } 2274 /** 2275 * 2276 * 2277 * <pre> 2278 * The IAM policy directly set on the given resource. Note that the original 2279 * IAM policy can contain multiple bindings. This only contains the bindings 2280 * that match the given query. For queries that don't contain a constrain on 2281 * policies (e.g., an empty query), this contains all the bindings. 2282 * To search against the `policy` bindings: 2283 * * use a field query: 2284 * - query by the policy contained members. Example: 2285 * `policy:amy@gmail.com` 2286 * - query by the policy contained roles. Example: 2287 * `policy:roles/compute.admin` 2288 * - query by the policy contained roles' included permissions. Example: 2289 * `policy.role.permissions:compute.instances.create` 2290 * </pre> 2291 * 2292 * <code>.google.iam.v1.Policy policy = 3;</code> 2293 * 2294 * @return The policy. 2295 */ 2296 @java.lang.Override getPolicy()2297 public com.google.iam.v1.Policy getPolicy() { 2298 return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; 2299 } 2300 /** 2301 * 2302 * 2303 * <pre> 2304 * The IAM policy directly set on the given resource. Note that the original 2305 * IAM policy can contain multiple bindings. This only contains the bindings 2306 * that match the given query. For queries that don't contain a constrain on 2307 * policies (e.g., an empty query), this contains all the bindings. 2308 * To search against the `policy` bindings: 2309 * * use a field query: 2310 * - query by the policy contained members. Example: 2311 * `policy:amy@gmail.com` 2312 * - query by the policy contained roles. Example: 2313 * `policy:roles/compute.admin` 2314 * - query by the policy contained roles' included permissions. Example: 2315 * `policy.role.permissions:compute.instances.create` 2316 * </pre> 2317 * 2318 * <code>.google.iam.v1.Policy policy = 3;</code> 2319 */ 2320 @java.lang.Override getPolicyOrBuilder()2321 public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { 2322 return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; 2323 } 2324 2325 public static final int EXPLANATION_FIELD_NUMBER = 4; 2326 private com.google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation_; 2327 /** 2328 * 2329 * 2330 * <pre> 2331 * Explanation about the IAM policy search result. It contains additional 2332 * information to explain why the search result matches the query. 2333 * </pre> 2334 * 2335 * <code>.google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation = 4;</code> 2336 * 2337 * @return Whether the explanation field is set. 2338 */ 2339 @java.lang.Override hasExplanation()2340 public boolean hasExplanation() { 2341 return explanation_ != null; 2342 } 2343 /** 2344 * 2345 * 2346 * <pre> 2347 * Explanation about the IAM policy search result. It contains additional 2348 * information to explain why the search result matches the query. 2349 * </pre> 2350 * 2351 * <code>.google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation = 4;</code> 2352 * 2353 * @return The explanation. 2354 */ 2355 @java.lang.Override getExplanation()2356 public com.google.cloud.asset.v1.IamPolicySearchResult.Explanation getExplanation() { 2357 return explanation_ == null 2358 ? com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.getDefaultInstance() 2359 : explanation_; 2360 } 2361 /** 2362 * 2363 * 2364 * <pre> 2365 * Explanation about the IAM policy search result. It contains additional 2366 * information to explain why the search result matches the query. 2367 * </pre> 2368 * 2369 * <code>.google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation = 4;</code> 2370 */ 2371 @java.lang.Override 2372 public com.google.cloud.asset.v1.IamPolicySearchResult.ExplanationOrBuilder getExplanationOrBuilder()2373 getExplanationOrBuilder() { 2374 return explanation_ == null 2375 ? com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.getDefaultInstance() 2376 : explanation_; 2377 } 2378 2379 private byte memoizedIsInitialized = -1; 2380 2381 @java.lang.Override isInitialized()2382 public final boolean isInitialized() { 2383 byte isInitialized = memoizedIsInitialized; 2384 if (isInitialized == 1) return true; 2385 if (isInitialized == 0) return false; 2386 2387 memoizedIsInitialized = 1; 2388 return true; 2389 } 2390 2391 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)2392 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 2393 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { 2394 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resource_); 2395 } 2396 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { 2397 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, project_); 2398 } 2399 if (policy_ != null) { 2400 output.writeMessage(3, getPolicy()); 2401 } 2402 if (explanation_ != null) { 2403 output.writeMessage(4, getExplanation()); 2404 } 2405 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(assetType_)) { 2406 com.google.protobuf.GeneratedMessageV3.writeString(output, 5, assetType_); 2407 } 2408 for (int i = 0; i < folders_.size(); i++) { 2409 com.google.protobuf.GeneratedMessageV3.writeString(output, 6, folders_.getRaw(i)); 2410 } 2411 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(organization_)) { 2412 com.google.protobuf.GeneratedMessageV3.writeString(output, 7, organization_); 2413 } 2414 getUnknownFields().writeTo(output); 2415 } 2416 2417 @java.lang.Override getSerializedSize()2418 public int getSerializedSize() { 2419 int size = memoizedSize; 2420 if (size != -1) return size; 2421 2422 size = 0; 2423 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { 2424 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resource_); 2425 } 2426 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { 2427 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, project_); 2428 } 2429 if (policy_ != null) { 2430 size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPolicy()); 2431 } 2432 if (explanation_ != null) { 2433 size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getExplanation()); 2434 } 2435 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(assetType_)) { 2436 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, assetType_); 2437 } 2438 { 2439 int dataSize = 0; 2440 for (int i = 0; i < folders_.size(); i++) { 2441 dataSize += computeStringSizeNoTag(folders_.getRaw(i)); 2442 } 2443 size += dataSize; 2444 size += 1 * getFoldersList().size(); 2445 } 2446 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(organization_)) { 2447 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, organization_); 2448 } 2449 size += getUnknownFields().getSerializedSize(); 2450 memoizedSize = size; 2451 return size; 2452 } 2453 2454 @java.lang.Override equals(final java.lang.Object obj)2455 public boolean equals(final java.lang.Object obj) { 2456 if (obj == this) { 2457 return true; 2458 } 2459 if (!(obj instanceof com.google.cloud.asset.v1.IamPolicySearchResult)) { 2460 return super.equals(obj); 2461 } 2462 com.google.cloud.asset.v1.IamPolicySearchResult other = 2463 (com.google.cloud.asset.v1.IamPolicySearchResult) obj; 2464 2465 if (!getResource().equals(other.getResource())) return false; 2466 if (!getAssetType().equals(other.getAssetType())) return false; 2467 if (!getProject().equals(other.getProject())) return false; 2468 if (!getFoldersList().equals(other.getFoldersList())) return false; 2469 if (!getOrganization().equals(other.getOrganization())) return false; 2470 if (hasPolicy() != other.hasPolicy()) return false; 2471 if (hasPolicy()) { 2472 if (!getPolicy().equals(other.getPolicy())) return false; 2473 } 2474 if (hasExplanation() != other.hasExplanation()) return false; 2475 if (hasExplanation()) { 2476 if (!getExplanation().equals(other.getExplanation())) return false; 2477 } 2478 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 2479 return true; 2480 } 2481 2482 @java.lang.Override hashCode()2483 public int hashCode() { 2484 if (memoizedHashCode != 0) { 2485 return memoizedHashCode; 2486 } 2487 int hash = 41; 2488 hash = (19 * hash) + getDescriptor().hashCode(); 2489 hash = (37 * hash) + RESOURCE_FIELD_NUMBER; 2490 hash = (53 * hash) + getResource().hashCode(); 2491 hash = (37 * hash) + ASSET_TYPE_FIELD_NUMBER; 2492 hash = (53 * hash) + getAssetType().hashCode(); 2493 hash = (37 * hash) + PROJECT_FIELD_NUMBER; 2494 hash = (53 * hash) + getProject().hashCode(); 2495 if (getFoldersCount() > 0) { 2496 hash = (37 * hash) + FOLDERS_FIELD_NUMBER; 2497 hash = (53 * hash) + getFoldersList().hashCode(); 2498 } 2499 hash = (37 * hash) + ORGANIZATION_FIELD_NUMBER; 2500 hash = (53 * hash) + getOrganization().hashCode(); 2501 if (hasPolicy()) { 2502 hash = (37 * hash) + POLICY_FIELD_NUMBER; 2503 hash = (53 * hash) + getPolicy().hashCode(); 2504 } 2505 if (hasExplanation()) { 2506 hash = (37 * hash) + EXPLANATION_FIELD_NUMBER; 2507 hash = (53 * hash) + getExplanation().hashCode(); 2508 } 2509 hash = (29 * hash) + getUnknownFields().hashCode(); 2510 memoizedHashCode = hash; 2511 return hash; 2512 } 2513 parseFrom(java.nio.ByteBuffer data)2514 public static com.google.cloud.asset.v1.IamPolicySearchResult parseFrom(java.nio.ByteBuffer data) 2515 throws com.google.protobuf.InvalidProtocolBufferException { 2516 return PARSER.parseFrom(data); 2517 } 2518 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2519 public static com.google.cloud.asset.v1.IamPolicySearchResult parseFrom( 2520 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2521 throws com.google.protobuf.InvalidProtocolBufferException { 2522 return PARSER.parseFrom(data, extensionRegistry); 2523 } 2524 parseFrom( com.google.protobuf.ByteString data)2525 public static com.google.cloud.asset.v1.IamPolicySearchResult parseFrom( 2526 com.google.protobuf.ByteString data) 2527 throws com.google.protobuf.InvalidProtocolBufferException { 2528 return PARSER.parseFrom(data); 2529 } 2530 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2531 public static com.google.cloud.asset.v1.IamPolicySearchResult parseFrom( 2532 com.google.protobuf.ByteString data, 2533 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2534 throws com.google.protobuf.InvalidProtocolBufferException { 2535 return PARSER.parseFrom(data, extensionRegistry); 2536 } 2537 parseFrom(byte[] data)2538 public static com.google.cloud.asset.v1.IamPolicySearchResult parseFrom(byte[] data) 2539 throws com.google.protobuf.InvalidProtocolBufferException { 2540 return PARSER.parseFrom(data); 2541 } 2542 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2543 public static com.google.cloud.asset.v1.IamPolicySearchResult parseFrom( 2544 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2545 throws com.google.protobuf.InvalidProtocolBufferException { 2546 return PARSER.parseFrom(data, extensionRegistry); 2547 } 2548 parseFrom(java.io.InputStream input)2549 public static com.google.cloud.asset.v1.IamPolicySearchResult parseFrom(java.io.InputStream input) 2550 throws java.io.IOException { 2551 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 2552 } 2553 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2554 public static com.google.cloud.asset.v1.IamPolicySearchResult parseFrom( 2555 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2556 throws java.io.IOException { 2557 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 2558 PARSER, input, extensionRegistry); 2559 } 2560 parseDelimitedFrom( java.io.InputStream input)2561 public static com.google.cloud.asset.v1.IamPolicySearchResult parseDelimitedFrom( 2562 java.io.InputStream input) throws java.io.IOException { 2563 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 2564 } 2565 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2566 public static com.google.cloud.asset.v1.IamPolicySearchResult parseDelimitedFrom( 2567 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2568 throws java.io.IOException { 2569 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 2570 PARSER, input, extensionRegistry); 2571 } 2572 parseFrom( com.google.protobuf.CodedInputStream input)2573 public static com.google.cloud.asset.v1.IamPolicySearchResult parseFrom( 2574 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 2575 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 2576 } 2577 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2578 public static com.google.cloud.asset.v1.IamPolicySearchResult parseFrom( 2579 com.google.protobuf.CodedInputStream input, 2580 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2581 throws java.io.IOException { 2582 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 2583 PARSER, input, extensionRegistry); 2584 } 2585 2586 @java.lang.Override newBuilderForType()2587 public Builder newBuilderForType() { 2588 return newBuilder(); 2589 } 2590 newBuilder()2591 public static Builder newBuilder() { 2592 return DEFAULT_INSTANCE.toBuilder(); 2593 } 2594 newBuilder(com.google.cloud.asset.v1.IamPolicySearchResult prototype)2595 public static Builder newBuilder(com.google.cloud.asset.v1.IamPolicySearchResult prototype) { 2596 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 2597 } 2598 2599 @java.lang.Override toBuilder()2600 public Builder toBuilder() { 2601 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 2602 } 2603 2604 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2605 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 2606 Builder builder = new Builder(parent); 2607 return builder; 2608 } 2609 /** 2610 * 2611 * 2612 * <pre> 2613 * A result of IAM Policy search, containing information of an IAM policy. 2614 * </pre> 2615 * 2616 * Protobuf type {@code google.cloud.asset.v1.IamPolicySearchResult} 2617 */ 2618 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 2619 implements 2620 // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1.IamPolicySearchResult) 2621 com.google.cloud.asset.v1.IamPolicySearchResultOrBuilder { getDescriptor()2622 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 2623 return com.google.cloud.asset.v1.AssetProto 2624 .internal_static_google_cloud_asset_v1_IamPolicySearchResult_descriptor; 2625 } 2626 2627 @java.lang.Override 2628 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()2629 internalGetFieldAccessorTable() { 2630 return com.google.cloud.asset.v1.AssetProto 2631 .internal_static_google_cloud_asset_v1_IamPolicySearchResult_fieldAccessorTable 2632 .ensureFieldAccessorsInitialized( 2633 com.google.cloud.asset.v1.IamPolicySearchResult.class, 2634 com.google.cloud.asset.v1.IamPolicySearchResult.Builder.class); 2635 } 2636 2637 // Construct using com.google.cloud.asset.v1.IamPolicySearchResult.newBuilder() Builder()2638 private Builder() {} 2639 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2640 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 2641 super(parent); 2642 } 2643 2644 @java.lang.Override clear()2645 public Builder clear() { 2646 super.clear(); 2647 bitField0_ = 0; 2648 resource_ = ""; 2649 assetType_ = ""; 2650 project_ = ""; 2651 folders_ = com.google.protobuf.LazyStringArrayList.EMPTY; 2652 bitField0_ = (bitField0_ & ~0x00000008); 2653 organization_ = ""; 2654 policy_ = null; 2655 if (policyBuilder_ != null) { 2656 policyBuilder_.dispose(); 2657 policyBuilder_ = null; 2658 } 2659 explanation_ = null; 2660 if (explanationBuilder_ != null) { 2661 explanationBuilder_.dispose(); 2662 explanationBuilder_ = null; 2663 } 2664 return this; 2665 } 2666 2667 @java.lang.Override getDescriptorForType()2668 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 2669 return com.google.cloud.asset.v1.AssetProto 2670 .internal_static_google_cloud_asset_v1_IamPolicySearchResult_descriptor; 2671 } 2672 2673 @java.lang.Override getDefaultInstanceForType()2674 public com.google.cloud.asset.v1.IamPolicySearchResult getDefaultInstanceForType() { 2675 return com.google.cloud.asset.v1.IamPolicySearchResult.getDefaultInstance(); 2676 } 2677 2678 @java.lang.Override build()2679 public com.google.cloud.asset.v1.IamPolicySearchResult build() { 2680 com.google.cloud.asset.v1.IamPolicySearchResult result = buildPartial(); 2681 if (!result.isInitialized()) { 2682 throw newUninitializedMessageException(result); 2683 } 2684 return result; 2685 } 2686 2687 @java.lang.Override buildPartial()2688 public com.google.cloud.asset.v1.IamPolicySearchResult buildPartial() { 2689 com.google.cloud.asset.v1.IamPolicySearchResult result = 2690 new com.google.cloud.asset.v1.IamPolicySearchResult(this); 2691 buildPartialRepeatedFields(result); 2692 if (bitField0_ != 0) { 2693 buildPartial0(result); 2694 } 2695 onBuilt(); 2696 return result; 2697 } 2698 buildPartialRepeatedFields( com.google.cloud.asset.v1.IamPolicySearchResult result)2699 private void buildPartialRepeatedFields( 2700 com.google.cloud.asset.v1.IamPolicySearchResult result) { 2701 if (((bitField0_ & 0x00000008) != 0)) { 2702 folders_ = folders_.getUnmodifiableView(); 2703 bitField0_ = (bitField0_ & ~0x00000008); 2704 } 2705 result.folders_ = folders_; 2706 } 2707 buildPartial0(com.google.cloud.asset.v1.IamPolicySearchResult result)2708 private void buildPartial0(com.google.cloud.asset.v1.IamPolicySearchResult result) { 2709 int from_bitField0_ = bitField0_; 2710 if (((from_bitField0_ & 0x00000001) != 0)) { 2711 result.resource_ = resource_; 2712 } 2713 if (((from_bitField0_ & 0x00000002) != 0)) { 2714 result.assetType_ = assetType_; 2715 } 2716 if (((from_bitField0_ & 0x00000004) != 0)) { 2717 result.project_ = project_; 2718 } 2719 if (((from_bitField0_ & 0x00000010) != 0)) { 2720 result.organization_ = organization_; 2721 } 2722 if (((from_bitField0_ & 0x00000020) != 0)) { 2723 result.policy_ = policyBuilder_ == null ? policy_ : policyBuilder_.build(); 2724 } 2725 if (((from_bitField0_ & 0x00000040) != 0)) { 2726 result.explanation_ = 2727 explanationBuilder_ == null ? explanation_ : explanationBuilder_.build(); 2728 } 2729 } 2730 2731 @java.lang.Override clone()2732 public Builder clone() { 2733 return super.clone(); 2734 } 2735 2736 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2737 public Builder setField( 2738 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 2739 return super.setField(field, value); 2740 } 2741 2742 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)2743 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 2744 return super.clearField(field); 2745 } 2746 2747 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)2748 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 2749 return super.clearOneof(oneof); 2750 } 2751 2752 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)2753 public Builder setRepeatedField( 2754 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 2755 return super.setRepeatedField(field, index, value); 2756 } 2757 2758 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2759 public Builder addRepeatedField( 2760 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 2761 return super.addRepeatedField(field, value); 2762 } 2763 2764 @java.lang.Override mergeFrom(com.google.protobuf.Message other)2765 public Builder mergeFrom(com.google.protobuf.Message other) { 2766 if (other instanceof com.google.cloud.asset.v1.IamPolicySearchResult) { 2767 return mergeFrom((com.google.cloud.asset.v1.IamPolicySearchResult) other); 2768 } else { 2769 super.mergeFrom(other); 2770 return this; 2771 } 2772 } 2773 mergeFrom(com.google.cloud.asset.v1.IamPolicySearchResult other)2774 public Builder mergeFrom(com.google.cloud.asset.v1.IamPolicySearchResult other) { 2775 if (other == com.google.cloud.asset.v1.IamPolicySearchResult.getDefaultInstance()) 2776 return this; 2777 if (!other.getResource().isEmpty()) { 2778 resource_ = other.resource_; 2779 bitField0_ |= 0x00000001; 2780 onChanged(); 2781 } 2782 if (!other.getAssetType().isEmpty()) { 2783 assetType_ = other.assetType_; 2784 bitField0_ |= 0x00000002; 2785 onChanged(); 2786 } 2787 if (!other.getProject().isEmpty()) { 2788 project_ = other.project_; 2789 bitField0_ |= 0x00000004; 2790 onChanged(); 2791 } 2792 if (!other.folders_.isEmpty()) { 2793 if (folders_.isEmpty()) { 2794 folders_ = other.folders_; 2795 bitField0_ = (bitField0_ & ~0x00000008); 2796 } else { 2797 ensureFoldersIsMutable(); 2798 folders_.addAll(other.folders_); 2799 } 2800 onChanged(); 2801 } 2802 if (!other.getOrganization().isEmpty()) { 2803 organization_ = other.organization_; 2804 bitField0_ |= 0x00000010; 2805 onChanged(); 2806 } 2807 if (other.hasPolicy()) { 2808 mergePolicy(other.getPolicy()); 2809 } 2810 if (other.hasExplanation()) { 2811 mergeExplanation(other.getExplanation()); 2812 } 2813 this.mergeUnknownFields(other.getUnknownFields()); 2814 onChanged(); 2815 return this; 2816 } 2817 2818 @java.lang.Override isInitialized()2819 public final boolean isInitialized() { 2820 return true; 2821 } 2822 2823 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2824 public Builder mergeFrom( 2825 com.google.protobuf.CodedInputStream input, 2826 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2827 throws java.io.IOException { 2828 if (extensionRegistry == null) { 2829 throw new java.lang.NullPointerException(); 2830 } 2831 try { 2832 boolean done = false; 2833 while (!done) { 2834 int tag = input.readTag(); 2835 switch (tag) { 2836 case 0: 2837 done = true; 2838 break; 2839 case 10: 2840 { 2841 resource_ = input.readStringRequireUtf8(); 2842 bitField0_ |= 0x00000001; 2843 break; 2844 } // case 10 2845 case 18: 2846 { 2847 project_ = input.readStringRequireUtf8(); 2848 bitField0_ |= 0x00000004; 2849 break; 2850 } // case 18 2851 case 26: 2852 { 2853 input.readMessage(getPolicyFieldBuilder().getBuilder(), extensionRegistry); 2854 bitField0_ |= 0x00000020; 2855 break; 2856 } // case 26 2857 case 34: 2858 { 2859 input.readMessage(getExplanationFieldBuilder().getBuilder(), extensionRegistry); 2860 bitField0_ |= 0x00000040; 2861 break; 2862 } // case 34 2863 case 42: 2864 { 2865 assetType_ = input.readStringRequireUtf8(); 2866 bitField0_ |= 0x00000002; 2867 break; 2868 } // case 42 2869 case 50: 2870 { 2871 java.lang.String s = input.readStringRequireUtf8(); 2872 ensureFoldersIsMutable(); 2873 folders_.add(s); 2874 break; 2875 } // case 50 2876 case 58: 2877 { 2878 organization_ = input.readStringRequireUtf8(); 2879 bitField0_ |= 0x00000010; 2880 break; 2881 } // case 58 2882 default: 2883 { 2884 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 2885 done = true; // was an endgroup tag 2886 } 2887 break; 2888 } // default: 2889 } // switch (tag) 2890 } // while (!done) 2891 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 2892 throw e.unwrapIOException(); 2893 } finally { 2894 onChanged(); 2895 } // finally 2896 return this; 2897 } 2898 2899 private int bitField0_; 2900 2901 private java.lang.Object resource_ = ""; 2902 /** 2903 * 2904 * 2905 * <pre> 2906 * The full resource name of the resource associated with this IAM policy. 2907 * Example: 2908 * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. 2909 * See [Cloud Asset Inventory Resource Name 2910 * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) 2911 * for more information. 2912 * To search against the `resource`: 2913 * * use a field query. Example: `resource:organizations/123` 2914 * </pre> 2915 * 2916 * <code>string resource = 1;</code> 2917 * 2918 * @return The resource. 2919 */ getResource()2920 public java.lang.String getResource() { 2921 java.lang.Object ref = resource_; 2922 if (!(ref instanceof java.lang.String)) { 2923 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2924 java.lang.String s = bs.toStringUtf8(); 2925 resource_ = s; 2926 return s; 2927 } else { 2928 return (java.lang.String) ref; 2929 } 2930 } 2931 /** 2932 * 2933 * 2934 * <pre> 2935 * The full resource name of the resource associated with this IAM policy. 2936 * Example: 2937 * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. 2938 * See [Cloud Asset Inventory Resource Name 2939 * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) 2940 * for more information. 2941 * To search against the `resource`: 2942 * * use a field query. Example: `resource:organizations/123` 2943 * </pre> 2944 * 2945 * <code>string resource = 1;</code> 2946 * 2947 * @return The bytes for resource. 2948 */ getResourceBytes()2949 public com.google.protobuf.ByteString getResourceBytes() { 2950 java.lang.Object ref = resource_; 2951 if (ref instanceof String) { 2952 com.google.protobuf.ByteString b = 2953 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2954 resource_ = b; 2955 return b; 2956 } else { 2957 return (com.google.protobuf.ByteString) ref; 2958 } 2959 } 2960 /** 2961 * 2962 * 2963 * <pre> 2964 * The full resource name of the resource associated with this IAM policy. 2965 * Example: 2966 * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. 2967 * See [Cloud Asset Inventory Resource Name 2968 * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) 2969 * for more information. 2970 * To search against the `resource`: 2971 * * use a field query. Example: `resource:organizations/123` 2972 * </pre> 2973 * 2974 * <code>string resource = 1;</code> 2975 * 2976 * @param value The resource to set. 2977 * @return This builder for chaining. 2978 */ setResource(java.lang.String value)2979 public Builder setResource(java.lang.String value) { 2980 if (value == null) { 2981 throw new NullPointerException(); 2982 } 2983 resource_ = value; 2984 bitField0_ |= 0x00000001; 2985 onChanged(); 2986 return this; 2987 } 2988 /** 2989 * 2990 * 2991 * <pre> 2992 * The full resource name of the resource associated with this IAM policy. 2993 * Example: 2994 * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. 2995 * See [Cloud Asset Inventory Resource Name 2996 * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) 2997 * for more information. 2998 * To search against the `resource`: 2999 * * use a field query. Example: `resource:organizations/123` 3000 * </pre> 3001 * 3002 * <code>string resource = 1;</code> 3003 * 3004 * @return This builder for chaining. 3005 */ clearResource()3006 public Builder clearResource() { 3007 resource_ = getDefaultInstance().getResource(); 3008 bitField0_ = (bitField0_ & ~0x00000001); 3009 onChanged(); 3010 return this; 3011 } 3012 /** 3013 * 3014 * 3015 * <pre> 3016 * The full resource name of the resource associated with this IAM policy. 3017 * Example: 3018 * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. 3019 * See [Cloud Asset Inventory Resource Name 3020 * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) 3021 * for more information. 3022 * To search against the `resource`: 3023 * * use a field query. Example: `resource:organizations/123` 3024 * </pre> 3025 * 3026 * <code>string resource = 1;</code> 3027 * 3028 * @param value The bytes for resource to set. 3029 * @return This builder for chaining. 3030 */ setResourceBytes(com.google.protobuf.ByteString value)3031 public Builder setResourceBytes(com.google.protobuf.ByteString value) { 3032 if (value == null) { 3033 throw new NullPointerException(); 3034 } 3035 checkByteStringIsUtf8(value); 3036 resource_ = value; 3037 bitField0_ |= 0x00000001; 3038 onChanged(); 3039 return this; 3040 } 3041 3042 private java.lang.Object assetType_ = ""; 3043 /** 3044 * 3045 * 3046 * <pre> 3047 * The type of the resource associated with this IAM policy. Example: 3048 * `compute.googleapis.com/Disk`. 3049 * To search against the `asset_type`: 3050 * * specify the `asset_types` field in your search request. 3051 * </pre> 3052 * 3053 * <code>string asset_type = 5;</code> 3054 * 3055 * @return The assetType. 3056 */ getAssetType()3057 public java.lang.String getAssetType() { 3058 java.lang.Object ref = assetType_; 3059 if (!(ref instanceof java.lang.String)) { 3060 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 3061 java.lang.String s = bs.toStringUtf8(); 3062 assetType_ = s; 3063 return s; 3064 } else { 3065 return (java.lang.String) ref; 3066 } 3067 } 3068 /** 3069 * 3070 * 3071 * <pre> 3072 * The type of the resource associated with this IAM policy. Example: 3073 * `compute.googleapis.com/Disk`. 3074 * To search against the `asset_type`: 3075 * * specify the `asset_types` field in your search request. 3076 * </pre> 3077 * 3078 * <code>string asset_type = 5;</code> 3079 * 3080 * @return The bytes for assetType. 3081 */ getAssetTypeBytes()3082 public com.google.protobuf.ByteString getAssetTypeBytes() { 3083 java.lang.Object ref = assetType_; 3084 if (ref instanceof String) { 3085 com.google.protobuf.ByteString b = 3086 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 3087 assetType_ = b; 3088 return b; 3089 } else { 3090 return (com.google.protobuf.ByteString) ref; 3091 } 3092 } 3093 /** 3094 * 3095 * 3096 * <pre> 3097 * The type of the resource associated with this IAM policy. Example: 3098 * `compute.googleapis.com/Disk`. 3099 * To search against the `asset_type`: 3100 * * specify the `asset_types` field in your search request. 3101 * </pre> 3102 * 3103 * <code>string asset_type = 5;</code> 3104 * 3105 * @param value The assetType to set. 3106 * @return This builder for chaining. 3107 */ setAssetType(java.lang.String value)3108 public Builder setAssetType(java.lang.String value) { 3109 if (value == null) { 3110 throw new NullPointerException(); 3111 } 3112 assetType_ = value; 3113 bitField0_ |= 0x00000002; 3114 onChanged(); 3115 return this; 3116 } 3117 /** 3118 * 3119 * 3120 * <pre> 3121 * The type of the resource associated with this IAM policy. Example: 3122 * `compute.googleapis.com/Disk`. 3123 * To search against the `asset_type`: 3124 * * specify the `asset_types` field in your search request. 3125 * </pre> 3126 * 3127 * <code>string asset_type = 5;</code> 3128 * 3129 * @return This builder for chaining. 3130 */ clearAssetType()3131 public Builder clearAssetType() { 3132 assetType_ = getDefaultInstance().getAssetType(); 3133 bitField0_ = (bitField0_ & ~0x00000002); 3134 onChanged(); 3135 return this; 3136 } 3137 /** 3138 * 3139 * 3140 * <pre> 3141 * The type of the resource associated with this IAM policy. Example: 3142 * `compute.googleapis.com/Disk`. 3143 * To search against the `asset_type`: 3144 * * specify the `asset_types` field in your search request. 3145 * </pre> 3146 * 3147 * <code>string asset_type = 5;</code> 3148 * 3149 * @param value The bytes for assetType to set. 3150 * @return This builder for chaining. 3151 */ setAssetTypeBytes(com.google.protobuf.ByteString value)3152 public Builder setAssetTypeBytes(com.google.protobuf.ByteString value) { 3153 if (value == null) { 3154 throw new NullPointerException(); 3155 } 3156 checkByteStringIsUtf8(value); 3157 assetType_ = value; 3158 bitField0_ |= 0x00000002; 3159 onChanged(); 3160 return this; 3161 } 3162 3163 private java.lang.Object project_ = ""; 3164 /** 3165 * 3166 * 3167 * <pre> 3168 * The project that the associated Google Cloud resource belongs to, in the 3169 * form of projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource 3170 * (like VM instance, Cloud Storage bucket), the project field will indicate 3171 * the project that contains the resource. If an IAM policy is set on a folder 3172 * or orgnization, this field will be empty. 3173 * To search against the `project`: 3174 * * specify the `scope` field as this project in your search request. 3175 * </pre> 3176 * 3177 * <code>string project = 2;</code> 3178 * 3179 * @return The project. 3180 */ getProject()3181 public java.lang.String getProject() { 3182 java.lang.Object ref = project_; 3183 if (!(ref instanceof java.lang.String)) { 3184 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 3185 java.lang.String s = bs.toStringUtf8(); 3186 project_ = s; 3187 return s; 3188 } else { 3189 return (java.lang.String) ref; 3190 } 3191 } 3192 /** 3193 * 3194 * 3195 * <pre> 3196 * The project that the associated Google Cloud resource belongs to, in the 3197 * form of projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource 3198 * (like VM instance, Cloud Storage bucket), the project field will indicate 3199 * the project that contains the resource. If an IAM policy is set on a folder 3200 * or orgnization, this field will be empty. 3201 * To search against the `project`: 3202 * * specify the `scope` field as this project in your search request. 3203 * </pre> 3204 * 3205 * <code>string project = 2;</code> 3206 * 3207 * @return The bytes for project. 3208 */ getProjectBytes()3209 public com.google.protobuf.ByteString getProjectBytes() { 3210 java.lang.Object ref = project_; 3211 if (ref instanceof String) { 3212 com.google.protobuf.ByteString b = 3213 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 3214 project_ = b; 3215 return b; 3216 } else { 3217 return (com.google.protobuf.ByteString) ref; 3218 } 3219 } 3220 /** 3221 * 3222 * 3223 * <pre> 3224 * The project that the associated Google Cloud resource belongs to, in the 3225 * form of projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource 3226 * (like VM instance, Cloud Storage bucket), the project field will indicate 3227 * the project that contains the resource. If an IAM policy is set on a folder 3228 * or orgnization, this field will be empty. 3229 * To search against the `project`: 3230 * * specify the `scope` field as this project in your search request. 3231 * </pre> 3232 * 3233 * <code>string project = 2;</code> 3234 * 3235 * @param value The project to set. 3236 * @return This builder for chaining. 3237 */ setProject(java.lang.String value)3238 public Builder setProject(java.lang.String value) { 3239 if (value == null) { 3240 throw new NullPointerException(); 3241 } 3242 project_ = value; 3243 bitField0_ |= 0x00000004; 3244 onChanged(); 3245 return this; 3246 } 3247 /** 3248 * 3249 * 3250 * <pre> 3251 * The project that the associated Google Cloud resource belongs to, in the 3252 * form of projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource 3253 * (like VM instance, Cloud Storage bucket), the project field will indicate 3254 * the project that contains the resource. If an IAM policy is set on a folder 3255 * or orgnization, this field will be empty. 3256 * To search against the `project`: 3257 * * specify the `scope` field as this project in your search request. 3258 * </pre> 3259 * 3260 * <code>string project = 2;</code> 3261 * 3262 * @return This builder for chaining. 3263 */ clearProject()3264 public Builder clearProject() { 3265 project_ = getDefaultInstance().getProject(); 3266 bitField0_ = (bitField0_ & ~0x00000004); 3267 onChanged(); 3268 return this; 3269 } 3270 /** 3271 * 3272 * 3273 * <pre> 3274 * The project that the associated Google Cloud resource belongs to, in the 3275 * form of projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource 3276 * (like VM instance, Cloud Storage bucket), the project field will indicate 3277 * the project that contains the resource. If an IAM policy is set on a folder 3278 * or orgnization, this field will be empty. 3279 * To search against the `project`: 3280 * * specify the `scope` field as this project in your search request. 3281 * </pre> 3282 * 3283 * <code>string project = 2;</code> 3284 * 3285 * @param value The bytes for project to set. 3286 * @return This builder for chaining. 3287 */ setProjectBytes(com.google.protobuf.ByteString value)3288 public Builder setProjectBytes(com.google.protobuf.ByteString value) { 3289 if (value == null) { 3290 throw new NullPointerException(); 3291 } 3292 checkByteStringIsUtf8(value); 3293 project_ = value; 3294 bitField0_ |= 0x00000004; 3295 onChanged(); 3296 return this; 3297 } 3298 3299 private com.google.protobuf.LazyStringList folders_ = 3300 com.google.protobuf.LazyStringArrayList.EMPTY; 3301 ensureFoldersIsMutable()3302 private void ensureFoldersIsMutable() { 3303 if (!((bitField0_ & 0x00000008) != 0)) { 3304 folders_ = new com.google.protobuf.LazyStringArrayList(folders_); 3305 bitField0_ |= 0x00000008; 3306 } 3307 } 3308 /** 3309 * 3310 * 3311 * <pre> 3312 * The folder(s) that the IAM policy belongs to, in the form of 3313 * folders/{FOLDER_NUMBER}. This field is available when the IAM policy 3314 * belongs to one or more folders. 3315 * To search against `folders`: 3316 * * use a field query. Example: `folders:(123 OR 456)` 3317 * * use a free text query. Example: `123` 3318 * * specify the `scope` field as this folder in your search request. 3319 * </pre> 3320 * 3321 * <code>repeated string folders = 6;</code> 3322 * 3323 * @return A list containing the folders. 3324 */ getFoldersList()3325 public com.google.protobuf.ProtocolStringList getFoldersList() { 3326 return folders_.getUnmodifiableView(); 3327 } 3328 /** 3329 * 3330 * 3331 * <pre> 3332 * The folder(s) that the IAM policy belongs to, in the form of 3333 * folders/{FOLDER_NUMBER}. This field is available when the IAM policy 3334 * belongs to one or more folders. 3335 * To search against `folders`: 3336 * * use a field query. Example: `folders:(123 OR 456)` 3337 * * use a free text query. Example: `123` 3338 * * specify the `scope` field as this folder in your search request. 3339 * </pre> 3340 * 3341 * <code>repeated string folders = 6;</code> 3342 * 3343 * @return The count of folders. 3344 */ getFoldersCount()3345 public int getFoldersCount() { 3346 return folders_.size(); 3347 } 3348 /** 3349 * 3350 * 3351 * <pre> 3352 * The folder(s) that the IAM policy belongs to, in the form of 3353 * folders/{FOLDER_NUMBER}. This field is available when the IAM policy 3354 * belongs to one or more folders. 3355 * To search against `folders`: 3356 * * use a field query. Example: `folders:(123 OR 456)` 3357 * * use a free text query. Example: `123` 3358 * * specify the `scope` field as this folder in your search request. 3359 * </pre> 3360 * 3361 * <code>repeated string folders = 6;</code> 3362 * 3363 * @param index The index of the element to return. 3364 * @return The folders at the given index. 3365 */ getFolders(int index)3366 public java.lang.String getFolders(int index) { 3367 return folders_.get(index); 3368 } 3369 /** 3370 * 3371 * 3372 * <pre> 3373 * The folder(s) that the IAM policy belongs to, in the form of 3374 * folders/{FOLDER_NUMBER}. This field is available when the IAM policy 3375 * belongs to one or more folders. 3376 * To search against `folders`: 3377 * * use a field query. Example: `folders:(123 OR 456)` 3378 * * use a free text query. Example: `123` 3379 * * specify the `scope` field as this folder in your search request. 3380 * </pre> 3381 * 3382 * <code>repeated string folders = 6;</code> 3383 * 3384 * @param index The index of the value to return. 3385 * @return The bytes of the folders at the given index. 3386 */ getFoldersBytes(int index)3387 public com.google.protobuf.ByteString getFoldersBytes(int index) { 3388 return folders_.getByteString(index); 3389 } 3390 /** 3391 * 3392 * 3393 * <pre> 3394 * The folder(s) that the IAM policy belongs to, in the form of 3395 * folders/{FOLDER_NUMBER}. This field is available when the IAM policy 3396 * belongs to one or more folders. 3397 * To search against `folders`: 3398 * * use a field query. Example: `folders:(123 OR 456)` 3399 * * use a free text query. Example: `123` 3400 * * specify the `scope` field as this folder in your search request. 3401 * </pre> 3402 * 3403 * <code>repeated string folders = 6;</code> 3404 * 3405 * @param index The index to set the value at. 3406 * @param value The folders to set. 3407 * @return This builder for chaining. 3408 */ setFolders(int index, java.lang.String value)3409 public Builder setFolders(int index, java.lang.String value) { 3410 if (value == null) { 3411 throw new NullPointerException(); 3412 } 3413 ensureFoldersIsMutable(); 3414 folders_.set(index, value); 3415 onChanged(); 3416 return this; 3417 } 3418 /** 3419 * 3420 * 3421 * <pre> 3422 * The folder(s) that the IAM policy belongs to, in the form of 3423 * folders/{FOLDER_NUMBER}. This field is available when the IAM policy 3424 * belongs to one or more folders. 3425 * To search against `folders`: 3426 * * use a field query. Example: `folders:(123 OR 456)` 3427 * * use a free text query. Example: `123` 3428 * * specify the `scope` field as this folder in your search request. 3429 * </pre> 3430 * 3431 * <code>repeated string folders = 6;</code> 3432 * 3433 * @param value The folders to add. 3434 * @return This builder for chaining. 3435 */ addFolders(java.lang.String value)3436 public Builder addFolders(java.lang.String value) { 3437 if (value == null) { 3438 throw new NullPointerException(); 3439 } 3440 ensureFoldersIsMutable(); 3441 folders_.add(value); 3442 onChanged(); 3443 return this; 3444 } 3445 /** 3446 * 3447 * 3448 * <pre> 3449 * The folder(s) that the IAM policy belongs to, in the form of 3450 * folders/{FOLDER_NUMBER}. This field is available when the IAM policy 3451 * belongs to one or more folders. 3452 * To search against `folders`: 3453 * * use a field query. Example: `folders:(123 OR 456)` 3454 * * use a free text query. Example: `123` 3455 * * specify the `scope` field as this folder in your search request. 3456 * </pre> 3457 * 3458 * <code>repeated string folders = 6;</code> 3459 * 3460 * @param values The folders to add. 3461 * @return This builder for chaining. 3462 */ addAllFolders(java.lang.Iterable<java.lang.String> values)3463 public Builder addAllFolders(java.lang.Iterable<java.lang.String> values) { 3464 ensureFoldersIsMutable(); 3465 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, folders_); 3466 onChanged(); 3467 return this; 3468 } 3469 /** 3470 * 3471 * 3472 * <pre> 3473 * The folder(s) that the IAM policy belongs to, in the form of 3474 * folders/{FOLDER_NUMBER}. This field is available when the IAM policy 3475 * belongs to one or more folders. 3476 * To search against `folders`: 3477 * * use a field query. Example: `folders:(123 OR 456)` 3478 * * use a free text query. Example: `123` 3479 * * specify the `scope` field as this folder in your search request. 3480 * </pre> 3481 * 3482 * <code>repeated string folders = 6;</code> 3483 * 3484 * @return This builder for chaining. 3485 */ clearFolders()3486 public Builder clearFolders() { 3487 folders_ = com.google.protobuf.LazyStringArrayList.EMPTY; 3488 bitField0_ = (bitField0_ & ~0x00000008); 3489 onChanged(); 3490 return this; 3491 } 3492 /** 3493 * 3494 * 3495 * <pre> 3496 * The folder(s) that the IAM policy belongs to, in the form of 3497 * folders/{FOLDER_NUMBER}. This field is available when the IAM policy 3498 * belongs to one or more folders. 3499 * To search against `folders`: 3500 * * use a field query. Example: `folders:(123 OR 456)` 3501 * * use a free text query. Example: `123` 3502 * * specify the `scope` field as this folder in your search request. 3503 * </pre> 3504 * 3505 * <code>repeated string folders = 6;</code> 3506 * 3507 * @param value The bytes of the folders to add. 3508 * @return This builder for chaining. 3509 */ addFoldersBytes(com.google.protobuf.ByteString value)3510 public Builder addFoldersBytes(com.google.protobuf.ByteString value) { 3511 if (value == null) { 3512 throw new NullPointerException(); 3513 } 3514 checkByteStringIsUtf8(value); 3515 ensureFoldersIsMutable(); 3516 folders_.add(value); 3517 onChanged(); 3518 return this; 3519 } 3520 3521 private java.lang.Object organization_ = ""; 3522 /** 3523 * 3524 * 3525 * <pre> 3526 * The organization that the IAM policy belongs to, in the form 3527 * of organizations/{ORGANIZATION_NUMBER}. This field is available when the 3528 * IAM policy belongs to an organization. 3529 * To search against `organization`: 3530 * * use a field query. Example: `organization:123` 3531 * * use a free text query. Example: `123` 3532 * * specify the `scope` field as this organization in your search request. 3533 * </pre> 3534 * 3535 * <code>string organization = 7;</code> 3536 * 3537 * @return The organization. 3538 */ getOrganization()3539 public java.lang.String getOrganization() { 3540 java.lang.Object ref = organization_; 3541 if (!(ref instanceof java.lang.String)) { 3542 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 3543 java.lang.String s = bs.toStringUtf8(); 3544 organization_ = s; 3545 return s; 3546 } else { 3547 return (java.lang.String) ref; 3548 } 3549 } 3550 /** 3551 * 3552 * 3553 * <pre> 3554 * The organization that the IAM policy belongs to, in the form 3555 * of organizations/{ORGANIZATION_NUMBER}. This field is available when the 3556 * IAM policy belongs to an organization. 3557 * To search against `organization`: 3558 * * use a field query. Example: `organization:123` 3559 * * use a free text query. Example: `123` 3560 * * specify the `scope` field as this organization in your search request. 3561 * </pre> 3562 * 3563 * <code>string organization = 7;</code> 3564 * 3565 * @return The bytes for organization. 3566 */ getOrganizationBytes()3567 public com.google.protobuf.ByteString getOrganizationBytes() { 3568 java.lang.Object ref = organization_; 3569 if (ref instanceof String) { 3570 com.google.protobuf.ByteString b = 3571 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 3572 organization_ = b; 3573 return b; 3574 } else { 3575 return (com.google.protobuf.ByteString) ref; 3576 } 3577 } 3578 /** 3579 * 3580 * 3581 * <pre> 3582 * The organization that the IAM policy belongs to, in the form 3583 * of organizations/{ORGANIZATION_NUMBER}. This field is available when the 3584 * IAM policy belongs to an organization. 3585 * To search against `organization`: 3586 * * use a field query. Example: `organization:123` 3587 * * use a free text query. Example: `123` 3588 * * specify the `scope` field as this organization in your search request. 3589 * </pre> 3590 * 3591 * <code>string organization = 7;</code> 3592 * 3593 * @param value The organization to set. 3594 * @return This builder for chaining. 3595 */ setOrganization(java.lang.String value)3596 public Builder setOrganization(java.lang.String value) { 3597 if (value == null) { 3598 throw new NullPointerException(); 3599 } 3600 organization_ = value; 3601 bitField0_ |= 0x00000010; 3602 onChanged(); 3603 return this; 3604 } 3605 /** 3606 * 3607 * 3608 * <pre> 3609 * The organization that the IAM policy belongs to, in the form 3610 * of organizations/{ORGANIZATION_NUMBER}. This field is available when the 3611 * IAM policy belongs to an organization. 3612 * To search against `organization`: 3613 * * use a field query. Example: `organization:123` 3614 * * use a free text query. Example: `123` 3615 * * specify the `scope` field as this organization in your search request. 3616 * </pre> 3617 * 3618 * <code>string organization = 7;</code> 3619 * 3620 * @return This builder for chaining. 3621 */ clearOrganization()3622 public Builder clearOrganization() { 3623 organization_ = getDefaultInstance().getOrganization(); 3624 bitField0_ = (bitField0_ & ~0x00000010); 3625 onChanged(); 3626 return this; 3627 } 3628 /** 3629 * 3630 * 3631 * <pre> 3632 * The organization that the IAM policy belongs to, in the form 3633 * of organizations/{ORGANIZATION_NUMBER}. This field is available when the 3634 * IAM policy belongs to an organization. 3635 * To search against `organization`: 3636 * * use a field query. Example: `organization:123` 3637 * * use a free text query. Example: `123` 3638 * * specify the `scope` field as this organization in your search request. 3639 * </pre> 3640 * 3641 * <code>string organization = 7;</code> 3642 * 3643 * @param value The bytes for organization to set. 3644 * @return This builder for chaining. 3645 */ setOrganizationBytes(com.google.protobuf.ByteString value)3646 public Builder setOrganizationBytes(com.google.protobuf.ByteString value) { 3647 if (value == null) { 3648 throw new NullPointerException(); 3649 } 3650 checkByteStringIsUtf8(value); 3651 organization_ = value; 3652 bitField0_ |= 0x00000010; 3653 onChanged(); 3654 return this; 3655 } 3656 3657 private com.google.iam.v1.Policy policy_; 3658 private com.google.protobuf.SingleFieldBuilderV3< 3659 com.google.iam.v1.Policy, 3660 com.google.iam.v1.Policy.Builder, 3661 com.google.iam.v1.PolicyOrBuilder> 3662 policyBuilder_; 3663 /** 3664 * 3665 * 3666 * <pre> 3667 * The IAM policy directly set on the given resource. Note that the original 3668 * IAM policy can contain multiple bindings. This only contains the bindings 3669 * that match the given query. For queries that don't contain a constrain on 3670 * policies (e.g., an empty query), this contains all the bindings. 3671 * To search against the `policy` bindings: 3672 * * use a field query: 3673 * - query by the policy contained members. Example: 3674 * `policy:amy@gmail.com` 3675 * - query by the policy contained roles. Example: 3676 * `policy:roles/compute.admin` 3677 * - query by the policy contained roles' included permissions. Example: 3678 * `policy.role.permissions:compute.instances.create` 3679 * </pre> 3680 * 3681 * <code>.google.iam.v1.Policy policy = 3;</code> 3682 * 3683 * @return Whether the policy field is set. 3684 */ hasPolicy()3685 public boolean hasPolicy() { 3686 return ((bitField0_ & 0x00000020) != 0); 3687 } 3688 /** 3689 * 3690 * 3691 * <pre> 3692 * The IAM policy directly set on the given resource. Note that the original 3693 * IAM policy can contain multiple bindings. This only contains the bindings 3694 * that match the given query. For queries that don't contain a constrain on 3695 * policies (e.g., an empty query), this contains all the bindings. 3696 * To search against the `policy` bindings: 3697 * * use a field query: 3698 * - query by the policy contained members. Example: 3699 * `policy:amy@gmail.com` 3700 * - query by the policy contained roles. Example: 3701 * `policy:roles/compute.admin` 3702 * - query by the policy contained roles' included permissions. Example: 3703 * `policy.role.permissions:compute.instances.create` 3704 * </pre> 3705 * 3706 * <code>.google.iam.v1.Policy policy = 3;</code> 3707 * 3708 * @return The policy. 3709 */ getPolicy()3710 public com.google.iam.v1.Policy getPolicy() { 3711 if (policyBuilder_ == null) { 3712 return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; 3713 } else { 3714 return policyBuilder_.getMessage(); 3715 } 3716 } 3717 /** 3718 * 3719 * 3720 * <pre> 3721 * The IAM policy directly set on the given resource. Note that the original 3722 * IAM policy can contain multiple bindings. This only contains the bindings 3723 * that match the given query. For queries that don't contain a constrain on 3724 * policies (e.g., an empty query), this contains all the bindings. 3725 * To search against the `policy` bindings: 3726 * * use a field query: 3727 * - query by the policy contained members. Example: 3728 * `policy:amy@gmail.com` 3729 * - query by the policy contained roles. Example: 3730 * `policy:roles/compute.admin` 3731 * - query by the policy contained roles' included permissions. Example: 3732 * `policy.role.permissions:compute.instances.create` 3733 * </pre> 3734 * 3735 * <code>.google.iam.v1.Policy policy = 3;</code> 3736 */ setPolicy(com.google.iam.v1.Policy value)3737 public Builder setPolicy(com.google.iam.v1.Policy value) { 3738 if (policyBuilder_ == null) { 3739 if (value == null) { 3740 throw new NullPointerException(); 3741 } 3742 policy_ = value; 3743 } else { 3744 policyBuilder_.setMessage(value); 3745 } 3746 bitField0_ |= 0x00000020; 3747 onChanged(); 3748 return this; 3749 } 3750 /** 3751 * 3752 * 3753 * <pre> 3754 * The IAM policy directly set on the given resource. Note that the original 3755 * IAM policy can contain multiple bindings. This only contains the bindings 3756 * that match the given query. For queries that don't contain a constrain on 3757 * policies (e.g., an empty query), this contains all the bindings. 3758 * To search against the `policy` bindings: 3759 * * use a field query: 3760 * - query by the policy contained members. Example: 3761 * `policy:amy@gmail.com` 3762 * - query by the policy contained roles. Example: 3763 * `policy:roles/compute.admin` 3764 * - query by the policy contained roles' included permissions. Example: 3765 * `policy.role.permissions:compute.instances.create` 3766 * </pre> 3767 * 3768 * <code>.google.iam.v1.Policy policy = 3;</code> 3769 */ setPolicy(com.google.iam.v1.Policy.Builder builderForValue)3770 public Builder setPolicy(com.google.iam.v1.Policy.Builder builderForValue) { 3771 if (policyBuilder_ == null) { 3772 policy_ = builderForValue.build(); 3773 } else { 3774 policyBuilder_.setMessage(builderForValue.build()); 3775 } 3776 bitField0_ |= 0x00000020; 3777 onChanged(); 3778 return this; 3779 } 3780 /** 3781 * 3782 * 3783 * <pre> 3784 * The IAM policy directly set on the given resource. Note that the original 3785 * IAM policy can contain multiple bindings. This only contains the bindings 3786 * that match the given query. For queries that don't contain a constrain on 3787 * policies (e.g., an empty query), this contains all the bindings. 3788 * To search against the `policy` bindings: 3789 * * use a field query: 3790 * - query by the policy contained members. Example: 3791 * `policy:amy@gmail.com` 3792 * - query by the policy contained roles. Example: 3793 * `policy:roles/compute.admin` 3794 * - query by the policy contained roles' included permissions. Example: 3795 * `policy.role.permissions:compute.instances.create` 3796 * </pre> 3797 * 3798 * <code>.google.iam.v1.Policy policy = 3;</code> 3799 */ mergePolicy(com.google.iam.v1.Policy value)3800 public Builder mergePolicy(com.google.iam.v1.Policy value) { 3801 if (policyBuilder_ == null) { 3802 if (((bitField0_ & 0x00000020) != 0) 3803 && policy_ != null 3804 && policy_ != com.google.iam.v1.Policy.getDefaultInstance()) { 3805 getPolicyBuilder().mergeFrom(value); 3806 } else { 3807 policy_ = value; 3808 } 3809 } else { 3810 policyBuilder_.mergeFrom(value); 3811 } 3812 bitField0_ |= 0x00000020; 3813 onChanged(); 3814 return this; 3815 } 3816 /** 3817 * 3818 * 3819 * <pre> 3820 * The IAM policy directly set on the given resource. Note that the original 3821 * IAM policy can contain multiple bindings. This only contains the bindings 3822 * that match the given query. For queries that don't contain a constrain on 3823 * policies (e.g., an empty query), this contains all the bindings. 3824 * To search against the `policy` bindings: 3825 * * use a field query: 3826 * - query by the policy contained members. Example: 3827 * `policy:amy@gmail.com` 3828 * - query by the policy contained roles. Example: 3829 * `policy:roles/compute.admin` 3830 * - query by the policy contained roles' included permissions. Example: 3831 * `policy.role.permissions:compute.instances.create` 3832 * </pre> 3833 * 3834 * <code>.google.iam.v1.Policy policy = 3;</code> 3835 */ clearPolicy()3836 public Builder clearPolicy() { 3837 bitField0_ = (bitField0_ & ~0x00000020); 3838 policy_ = null; 3839 if (policyBuilder_ != null) { 3840 policyBuilder_.dispose(); 3841 policyBuilder_ = null; 3842 } 3843 onChanged(); 3844 return this; 3845 } 3846 /** 3847 * 3848 * 3849 * <pre> 3850 * The IAM policy directly set on the given resource. Note that the original 3851 * IAM policy can contain multiple bindings. This only contains the bindings 3852 * that match the given query. For queries that don't contain a constrain on 3853 * policies (e.g., an empty query), this contains all the bindings. 3854 * To search against the `policy` bindings: 3855 * * use a field query: 3856 * - query by the policy contained members. Example: 3857 * `policy:amy@gmail.com` 3858 * - query by the policy contained roles. Example: 3859 * `policy:roles/compute.admin` 3860 * - query by the policy contained roles' included permissions. Example: 3861 * `policy.role.permissions:compute.instances.create` 3862 * </pre> 3863 * 3864 * <code>.google.iam.v1.Policy policy = 3;</code> 3865 */ getPolicyBuilder()3866 public com.google.iam.v1.Policy.Builder getPolicyBuilder() { 3867 bitField0_ |= 0x00000020; 3868 onChanged(); 3869 return getPolicyFieldBuilder().getBuilder(); 3870 } 3871 /** 3872 * 3873 * 3874 * <pre> 3875 * The IAM policy directly set on the given resource. Note that the original 3876 * IAM policy can contain multiple bindings. This only contains the bindings 3877 * that match the given query. For queries that don't contain a constrain on 3878 * policies (e.g., an empty query), this contains all the bindings. 3879 * To search against the `policy` bindings: 3880 * * use a field query: 3881 * - query by the policy contained members. Example: 3882 * `policy:amy@gmail.com` 3883 * - query by the policy contained roles. Example: 3884 * `policy:roles/compute.admin` 3885 * - query by the policy contained roles' included permissions. Example: 3886 * `policy.role.permissions:compute.instances.create` 3887 * </pre> 3888 * 3889 * <code>.google.iam.v1.Policy policy = 3;</code> 3890 */ getPolicyOrBuilder()3891 public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { 3892 if (policyBuilder_ != null) { 3893 return policyBuilder_.getMessageOrBuilder(); 3894 } else { 3895 return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; 3896 } 3897 } 3898 /** 3899 * 3900 * 3901 * <pre> 3902 * The IAM policy directly set on the given resource. Note that the original 3903 * IAM policy can contain multiple bindings. This only contains the bindings 3904 * that match the given query. For queries that don't contain a constrain on 3905 * policies (e.g., an empty query), this contains all the bindings. 3906 * To search against the `policy` bindings: 3907 * * use a field query: 3908 * - query by the policy contained members. Example: 3909 * `policy:amy@gmail.com` 3910 * - query by the policy contained roles. Example: 3911 * `policy:roles/compute.admin` 3912 * - query by the policy contained roles' included permissions. Example: 3913 * `policy.role.permissions:compute.instances.create` 3914 * </pre> 3915 * 3916 * <code>.google.iam.v1.Policy policy = 3;</code> 3917 */ 3918 private com.google.protobuf.SingleFieldBuilderV3< 3919 com.google.iam.v1.Policy, 3920 com.google.iam.v1.Policy.Builder, 3921 com.google.iam.v1.PolicyOrBuilder> getPolicyFieldBuilder()3922 getPolicyFieldBuilder() { 3923 if (policyBuilder_ == null) { 3924 policyBuilder_ = 3925 new com.google.protobuf.SingleFieldBuilderV3< 3926 com.google.iam.v1.Policy, 3927 com.google.iam.v1.Policy.Builder, 3928 com.google.iam.v1.PolicyOrBuilder>(getPolicy(), getParentForChildren(), isClean()); 3929 policy_ = null; 3930 } 3931 return policyBuilder_; 3932 } 3933 3934 private com.google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation_; 3935 private com.google.protobuf.SingleFieldBuilderV3< 3936 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation, 3937 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Builder, 3938 com.google.cloud.asset.v1.IamPolicySearchResult.ExplanationOrBuilder> 3939 explanationBuilder_; 3940 /** 3941 * 3942 * 3943 * <pre> 3944 * Explanation about the IAM policy search result. It contains additional 3945 * information to explain why the search result matches the query. 3946 * </pre> 3947 * 3948 * <code>.google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation = 4;</code> 3949 * 3950 * @return Whether the explanation field is set. 3951 */ hasExplanation()3952 public boolean hasExplanation() { 3953 return ((bitField0_ & 0x00000040) != 0); 3954 } 3955 /** 3956 * 3957 * 3958 * <pre> 3959 * Explanation about the IAM policy search result. It contains additional 3960 * information to explain why the search result matches the query. 3961 * </pre> 3962 * 3963 * <code>.google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation = 4;</code> 3964 * 3965 * @return The explanation. 3966 */ getExplanation()3967 public com.google.cloud.asset.v1.IamPolicySearchResult.Explanation getExplanation() { 3968 if (explanationBuilder_ == null) { 3969 return explanation_ == null 3970 ? com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.getDefaultInstance() 3971 : explanation_; 3972 } else { 3973 return explanationBuilder_.getMessage(); 3974 } 3975 } 3976 /** 3977 * 3978 * 3979 * <pre> 3980 * Explanation about the IAM policy search result. It contains additional 3981 * information to explain why the search result matches the query. 3982 * </pre> 3983 * 3984 * <code>.google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation = 4;</code> 3985 */ setExplanation( com.google.cloud.asset.v1.IamPolicySearchResult.Explanation value)3986 public Builder setExplanation( 3987 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation value) { 3988 if (explanationBuilder_ == null) { 3989 if (value == null) { 3990 throw new NullPointerException(); 3991 } 3992 explanation_ = value; 3993 } else { 3994 explanationBuilder_.setMessage(value); 3995 } 3996 bitField0_ |= 0x00000040; 3997 onChanged(); 3998 return this; 3999 } 4000 /** 4001 * 4002 * 4003 * <pre> 4004 * Explanation about the IAM policy search result. It contains additional 4005 * information to explain why the search result matches the query. 4006 * </pre> 4007 * 4008 * <code>.google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation = 4;</code> 4009 */ setExplanation( com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Builder builderForValue)4010 public Builder setExplanation( 4011 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Builder builderForValue) { 4012 if (explanationBuilder_ == null) { 4013 explanation_ = builderForValue.build(); 4014 } else { 4015 explanationBuilder_.setMessage(builderForValue.build()); 4016 } 4017 bitField0_ |= 0x00000040; 4018 onChanged(); 4019 return this; 4020 } 4021 /** 4022 * 4023 * 4024 * <pre> 4025 * Explanation about the IAM policy search result. It contains additional 4026 * information to explain why the search result matches the query. 4027 * </pre> 4028 * 4029 * <code>.google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation = 4;</code> 4030 */ mergeExplanation( com.google.cloud.asset.v1.IamPolicySearchResult.Explanation value)4031 public Builder mergeExplanation( 4032 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation value) { 4033 if (explanationBuilder_ == null) { 4034 if (((bitField0_ & 0x00000040) != 0) 4035 && explanation_ != null 4036 && explanation_ 4037 != com.google.cloud.asset.v1.IamPolicySearchResult.Explanation 4038 .getDefaultInstance()) { 4039 getExplanationBuilder().mergeFrom(value); 4040 } else { 4041 explanation_ = value; 4042 } 4043 } else { 4044 explanationBuilder_.mergeFrom(value); 4045 } 4046 bitField0_ |= 0x00000040; 4047 onChanged(); 4048 return this; 4049 } 4050 /** 4051 * 4052 * 4053 * <pre> 4054 * Explanation about the IAM policy search result. It contains additional 4055 * information to explain why the search result matches the query. 4056 * </pre> 4057 * 4058 * <code>.google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation = 4;</code> 4059 */ clearExplanation()4060 public Builder clearExplanation() { 4061 bitField0_ = (bitField0_ & ~0x00000040); 4062 explanation_ = null; 4063 if (explanationBuilder_ != null) { 4064 explanationBuilder_.dispose(); 4065 explanationBuilder_ = null; 4066 } 4067 onChanged(); 4068 return this; 4069 } 4070 /** 4071 * 4072 * 4073 * <pre> 4074 * Explanation about the IAM policy search result. It contains additional 4075 * information to explain why the search result matches the query. 4076 * </pre> 4077 * 4078 * <code>.google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation = 4;</code> 4079 */ 4080 public com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Builder getExplanationBuilder()4081 getExplanationBuilder() { 4082 bitField0_ |= 0x00000040; 4083 onChanged(); 4084 return getExplanationFieldBuilder().getBuilder(); 4085 } 4086 /** 4087 * 4088 * 4089 * <pre> 4090 * Explanation about the IAM policy search result. It contains additional 4091 * information to explain why the search result matches the query. 4092 * </pre> 4093 * 4094 * <code>.google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation = 4;</code> 4095 */ 4096 public com.google.cloud.asset.v1.IamPolicySearchResult.ExplanationOrBuilder getExplanationOrBuilder()4097 getExplanationOrBuilder() { 4098 if (explanationBuilder_ != null) { 4099 return explanationBuilder_.getMessageOrBuilder(); 4100 } else { 4101 return explanation_ == null 4102 ? com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.getDefaultInstance() 4103 : explanation_; 4104 } 4105 } 4106 /** 4107 * 4108 * 4109 * <pre> 4110 * Explanation about the IAM policy search result. It contains additional 4111 * information to explain why the search result matches the query. 4112 * </pre> 4113 * 4114 * <code>.google.cloud.asset.v1.IamPolicySearchResult.Explanation explanation = 4;</code> 4115 */ 4116 private com.google.protobuf.SingleFieldBuilderV3< 4117 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation, 4118 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Builder, 4119 com.google.cloud.asset.v1.IamPolicySearchResult.ExplanationOrBuilder> getExplanationFieldBuilder()4120 getExplanationFieldBuilder() { 4121 if (explanationBuilder_ == null) { 4122 explanationBuilder_ = 4123 new com.google.protobuf.SingleFieldBuilderV3< 4124 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation, 4125 com.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Builder, 4126 com.google.cloud.asset.v1.IamPolicySearchResult.ExplanationOrBuilder>( 4127 getExplanation(), getParentForChildren(), isClean()); 4128 explanation_ = null; 4129 } 4130 return explanationBuilder_; 4131 } 4132 4133 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)4134 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 4135 return super.setUnknownFields(unknownFields); 4136 } 4137 4138 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)4139 public final Builder mergeUnknownFields( 4140 final com.google.protobuf.UnknownFieldSet unknownFields) { 4141 return super.mergeUnknownFields(unknownFields); 4142 } 4143 4144 // @@protoc_insertion_point(builder_scope:google.cloud.asset.v1.IamPolicySearchResult) 4145 } 4146 4147 // @@protoc_insertion_point(class_scope:google.cloud.asset.v1.IamPolicySearchResult) 4148 private static final com.google.cloud.asset.v1.IamPolicySearchResult DEFAULT_INSTANCE; 4149 4150 static { 4151 DEFAULT_INSTANCE = new com.google.cloud.asset.v1.IamPolicySearchResult(); 4152 } 4153 getDefaultInstance()4154 public static com.google.cloud.asset.v1.IamPolicySearchResult getDefaultInstance() { 4155 return DEFAULT_INSTANCE; 4156 } 4157 4158 private static final com.google.protobuf.Parser<IamPolicySearchResult> PARSER = 4159 new com.google.protobuf.AbstractParser<IamPolicySearchResult>() { 4160 @java.lang.Override 4161 public IamPolicySearchResult parsePartialFrom( 4162 com.google.protobuf.CodedInputStream input, 4163 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 4164 throws com.google.protobuf.InvalidProtocolBufferException { 4165 Builder builder = newBuilder(); 4166 try { 4167 builder.mergeFrom(input, extensionRegistry); 4168 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 4169 throw e.setUnfinishedMessage(builder.buildPartial()); 4170 } catch (com.google.protobuf.UninitializedMessageException e) { 4171 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 4172 } catch (java.io.IOException e) { 4173 throw new com.google.protobuf.InvalidProtocolBufferException(e) 4174 .setUnfinishedMessage(builder.buildPartial()); 4175 } 4176 return builder.buildPartial(); 4177 } 4178 }; 4179 parser()4180 public static com.google.protobuf.Parser<IamPolicySearchResult> parser() { 4181 return PARSER; 4182 } 4183 4184 @java.lang.Override getParserForType()4185 public com.google.protobuf.Parser<IamPolicySearchResult> getParserForType() { 4186 return PARSER; 4187 } 4188 4189 @java.lang.Override getDefaultInstanceForType()4190 public com.google.cloud.asset.v1.IamPolicySearchResult getDefaultInstanceForType() { 4191 return DEFAULT_INSTANCE; 4192 } 4193 } 4194