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