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