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/policy.proto 18 19 package com.google.iam.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * Associates `members`, or principals, with a `role`. 26 * </pre> 27 * 28 * Protobuf type {@code google.iam.v1.Binding} 29 */ 30 public final class Binding extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.iam.v1.Binding) 33 BindingOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use Binding.newBuilder() to construct. Binding(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private Binding(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 Binding()40 private Binding() { 41 role_ = ""; 42 members_ = 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 Binding(); 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.PolicyProto.internal_static_google_iam_v1_Binding_descriptor; 58 } 59 60 @java.lang.Override 61 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()62 internalGetFieldAccessorTable() { 63 return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_Binding_fieldAccessorTable 64 .ensureFieldAccessorsInitialized( 65 com.google.iam.v1.Binding.class, com.google.iam.v1.Binding.Builder.class); 66 } 67 68 public static final int ROLE_FIELD_NUMBER = 1; 69 70 @SuppressWarnings("serial") 71 private volatile java.lang.Object role_ = ""; 72 /** 73 * 74 * 75 * <pre> 76 * Role that is assigned to the list of `members`, or principals. 77 * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 78 * </pre> 79 * 80 * <code>string role = 1;</code> 81 * 82 * @return The role. 83 */ 84 @java.lang.Override getRole()85 public java.lang.String getRole() { 86 java.lang.Object ref = role_; 87 if (ref instanceof java.lang.String) { 88 return (java.lang.String) ref; 89 } else { 90 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 91 java.lang.String s = bs.toStringUtf8(); 92 role_ = s; 93 return s; 94 } 95 } 96 /** 97 * 98 * 99 * <pre> 100 * Role that is assigned to the list of `members`, or principals. 101 * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 102 * </pre> 103 * 104 * <code>string role = 1;</code> 105 * 106 * @return The bytes for role. 107 */ 108 @java.lang.Override getRoleBytes()109 public com.google.protobuf.ByteString getRoleBytes() { 110 java.lang.Object ref = role_; 111 if (ref instanceof java.lang.String) { 112 com.google.protobuf.ByteString b = 113 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 114 role_ = b; 115 return b; 116 } else { 117 return (com.google.protobuf.ByteString) ref; 118 } 119 } 120 121 public static final int MEMBERS_FIELD_NUMBER = 2; 122 123 @SuppressWarnings("serial") 124 private com.google.protobuf.LazyStringList members_; 125 /** 126 * 127 * 128 * <pre> 129 * Specifies the principals requesting access for a Cloud Platform resource. 130 * `members` can have the following values: 131 * * `allUsers`: A special identifier that represents anyone who is 132 * on the internet; with or without a Google account. 133 * * `allAuthenticatedUsers`: A special identifier that represents anyone 134 * who is authenticated with a Google account or a service account. 135 * * `user:{emailid}`: An email address that represents a specific Google 136 * account. For example, `alice@example.com` . 137 * * `serviceAccount:{emailid}`: An email address that represents a service 138 * account. For example, `my-other-app@appspot.gserviceaccount.com`. 139 * * `group:{emailid}`: An email address that represents a Google group. 140 * For example, `admins@example.com`. 141 * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique 142 * identifier) representing a user that has been recently deleted. For 143 * example, `alice@example.com?uid=123456789012345678901`. If the user is 144 * recovered, this value reverts to `user:{emailid}` and the recovered user 145 * retains the role in the binding. 146 * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 147 * unique identifier) representing a service account that has been recently 148 * deleted. For example, 149 * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 150 * If the service account is undeleted, this value reverts to 151 * `serviceAccount:{emailid}` and the undeleted service account retains the 152 * role in the binding. 153 * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique 154 * identifier) representing a Google group that has been recently 155 * deleted. For example, `admins@example.com?uid=123456789012345678901`. If 156 * the group is recovered, this value reverts to `group:{emailid}` and the 157 * recovered group retains the role in the binding. 158 * * `domain:{domain}`: The G Suite domain (primary) that represents all the 159 * users of that domain. For example, `google.com` or `example.com`. 160 * </pre> 161 * 162 * <code>repeated string members = 2;</code> 163 * 164 * @return A list containing the members. 165 */ getMembersList()166 public com.google.protobuf.ProtocolStringList getMembersList() { 167 return members_; 168 } 169 /** 170 * 171 * 172 * <pre> 173 * Specifies the principals requesting access for a Cloud Platform resource. 174 * `members` can have the following values: 175 * * `allUsers`: A special identifier that represents anyone who is 176 * on the internet; with or without a Google account. 177 * * `allAuthenticatedUsers`: A special identifier that represents anyone 178 * who is authenticated with a Google account or a service account. 179 * * `user:{emailid}`: An email address that represents a specific Google 180 * account. For example, `alice@example.com` . 181 * * `serviceAccount:{emailid}`: An email address that represents a service 182 * account. For example, `my-other-app@appspot.gserviceaccount.com`. 183 * * `group:{emailid}`: An email address that represents a Google group. 184 * For example, `admins@example.com`. 185 * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique 186 * identifier) representing a user that has been recently deleted. For 187 * example, `alice@example.com?uid=123456789012345678901`. If the user is 188 * recovered, this value reverts to `user:{emailid}` and the recovered user 189 * retains the role in the binding. 190 * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 191 * unique identifier) representing a service account that has been recently 192 * deleted. For example, 193 * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 194 * If the service account is undeleted, this value reverts to 195 * `serviceAccount:{emailid}` and the undeleted service account retains the 196 * role in the binding. 197 * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique 198 * identifier) representing a Google group that has been recently 199 * deleted. For example, `admins@example.com?uid=123456789012345678901`. If 200 * the group is recovered, this value reverts to `group:{emailid}` and the 201 * recovered group retains the role in the binding. 202 * * `domain:{domain}`: The G Suite domain (primary) that represents all the 203 * users of that domain. For example, `google.com` or `example.com`. 204 * </pre> 205 * 206 * <code>repeated string members = 2;</code> 207 * 208 * @return The count of members. 209 */ getMembersCount()210 public int getMembersCount() { 211 return members_.size(); 212 } 213 /** 214 * 215 * 216 * <pre> 217 * Specifies the principals requesting access for a Cloud Platform resource. 218 * `members` can have the following values: 219 * * `allUsers`: A special identifier that represents anyone who is 220 * on the internet; with or without a Google account. 221 * * `allAuthenticatedUsers`: A special identifier that represents anyone 222 * who is authenticated with a Google account or a service account. 223 * * `user:{emailid}`: An email address that represents a specific Google 224 * account. For example, `alice@example.com` . 225 * * `serviceAccount:{emailid}`: An email address that represents a service 226 * account. For example, `my-other-app@appspot.gserviceaccount.com`. 227 * * `group:{emailid}`: An email address that represents a Google group. 228 * For example, `admins@example.com`. 229 * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique 230 * identifier) representing a user that has been recently deleted. For 231 * example, `alice@example.com?uid=123456789012345678901`. If the user is 232 * recovered, this value reverts to `user:{emailid}` and the recovered user 233 * retains the role in the binding. 234 * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 235 * unique identifier) representing a service account that has been recently 236 * deleted. For example, 237 * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 238 * If the service account is undeleted, this value reverts to 239 * `serviceAccount:{emailid}` and the undeleted service account retains the 240 * role in the binding. 241 * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique 242 * identifier) representing a Google group that has been recently 243 * deleted. For example, `admins@example.com?uid=123456789012345678901`. If 244 * the group is recovered, this value reverts to `group:{emailid}` and the 245 * recovered group retains the role in the binding. 246 * * `domain:{domain}`: The G Suite domain (primary) that represents all the 247 * users of that domain. For example, `google.com` or `example.com`. 248 * </pre> 249 * 250 * <code>repeated string members = 2;</code> 251 * 252 * @param index The index of the element to return. 253 * @return The members at the given index. 254 */ getMembers(int index)255 public java.lang.String getMembers(int index) { 256 return members_.get(index); 257 } 258 /** 259 * 260 * 261 * <pre> 262 * Specifies the principals requesting access for a Cloud Platform resource. 263 * `members` can have the following values: 264 * * `allUsers`: A special identifier that represents anyone who is 265 * on the internet; with or without a Google account. 266 * * `allAuthenticatedUsers`: A special identifier that represents anyone 267 * who is authenticated with a Google account or a service account. 268 * * `user:{emailid}`: An email address that represents a specific Google 269 * account. For example, `alice@example.com` . 270 * * `serviceAccount:{emailid}`: An email address that represents a service 271 * account. For example, `my-other-app@appspot.gserviceaccount.com`. 272 * * `group:{emailid}`: An email address that represents a Google group. 273 * For example, `admins@example.com`. 274 * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique 275 * identifier) representing a user that has been recently deleted. For 276 * example, `alice@example.com?uid=123456789012345678901`. If the user is 277 * recovered, this value reverts to `user:{emailid}` and the recovered user 278 * retains the role in the binding. 279 * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 280 * unique identifier) representing a service account that has been recently 281 * deleted. For example, 282 * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 283 * If the service account is undeleted, this value reverts to 284 * `serviceAccount:{emailid}` and the undeleted service account retains the 285 * role in the binding. 286 * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique 287 * identifier) representing a Google group that has been recently 288 * deleted. For example, `admins@example.com?uid=123456789012345678901`. If 289 * the group is recovered, this value reverts to `group:{emailid}` and the 290 * recovered group retains the role in the binding. 291 * * `domain:{domain}`: The G Suite domain (primary) that represents all the 292 * users of that domain. For example, `google.com` or `example.com`. 293 * </pre> 294 * 295 * <code>repeated string members = 2;</code> 296 * 297 * @param index The index of the value to return. 298 * @return The bytes of the members at the given index. 299 */ getMembersBytes(int index)300 public com.google.protobuf.ByteString getMembersBytes(int index) { 301 return members_.getByteString(index); 302 } 303 304 public static final int CONDITION_FIELD_NUMBER = 3; 305 private com.google.type.Expr condition_; 306 /** 307 * 308 * 309 * <pre> 310 * The condition that is associated with this binding. 311 * If the condition evaluates to `true`, then this binding applies to the 312 * current request. 313 * If the condition evaluates to `false`, then this binding does not apply to 314 * the current request. However, a different role binding might grant the same 315 * role to one or more of the principals in this binding. 316 * To learn which resources support conditions in their IAM policies, see the 317 * [IAM 318 * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 319 * </pre> 320 * 321 * <code>.google.type.Expr condition = 3;</code> 322 * 323 * @return Whether the condition field is set. 324 */ 325 @java.lang.Override hasCondition()326 public boolean hasCondition() { 327 return condition_ != null; 328 } 329 /** 330 * 331 * 332 * <pre> 333 * The condition that is associated with this binding. 334 * If the condition evaluates to `true`, then this binding applies to the 335 * current request. 336 * If the condition evaluates to `false`, then this binding does not apply to 337 * the current request. However, a different role binding might grant the same 338 * role to one or more of the principals in this binding. 339 * To learn which resources support conditions in their IAM policies, see the 340 * [IAM 341 * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 342 * </pre> 343 * 344 * <code>.google.type.Expr condition = 3;</code> 345 * 346 * @return The condition. 347 */ 348 @java.lang.Override getCondition()349 public com.google.type.Expr getCondition() { 350 return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; 351 } 352 /** 353 * 354 * 355 * <pre> 356 * The condition that is associated with this binding. 357 * If the condition evaluates to `true`, then this binding applies to the 358 * current request. 359 * If the condition evaluates to `false`, then this binding does not apply to 360 * the current request. However, a different role binding might grant the same 361 * role to one or more of the principals in this binding. 362 * To learn which resources support conditions in their IAM policies, see the 363 * [IAM 364 * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 365 * </pre> 366 * 367 * <code>.google.type.Expr condition = 3;</code> 368 */ 369 @java.lang.Override getConditionOrBuilder()370 public com.google.type.ExprOrBuilder getConditionOrBuilder() { 371 return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; 372 } 373 374 private byte memoizedIsInitialized = -1; 375 376 @java.lang.Override isInitialized()377 public final boolean isInitialized() { 378 byte isInitialized = memoizedIsInitialized; 379 if (isInitialized == 1) return true; 380 if (isInitialized == 0) return false; 381 382 memoizedIsInitialized = 1; 383 return true; 384 } 385 386 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)387 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 388 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(role_)) { 389 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, role_); 390 } 391 for (int i = 0; i < members_.size(); i++) { 392 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, members_.getRaw(i)); 393 } 394 if (condition_ != null) { 395 output.writeMessage(3, getCondition()); 396 } 397 getUnknownFields().writeTo(output); 398 } 399 400 @java.lang.Override getSerializedSize()401 public int getSerializedSize() { 402 int size = memoizedSize; 403 if (size != -1) return size; 404 405 size = 0; 406 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(role_)) { 407 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, role_); 408 } 409 { 410 int dataSize = 0; 411 for (int i = 0; i < members_.size(); i++) { 412 dataSize += computeStringSizeNoTag(members_.getRaw(i)); 413 } 414 size += dataSize; 415 size += 1 * getMembersList().size(); 416 } 417 if (condition_ != null) { 418 size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCondition()); 419 } 420 size += getUnknownFields().getSerializedSize(); 421 memoizedSize = size; 422 return size; 423 } 424 425 @java.lang.Override equals(final java.lang.Object obj)426 public boolean equals(final java.lang.Object obj) { 427 if (obj == this) { 428 return true; 429 } 430 if (!(obj instanceof com.google.iam.v1.Binding)) { 431 return super.equals(obj); 432 } 433 com.google.iam.v1.Binding other = (com.google.iam.v1.Binding) obj; 434 435 if (!getRole().equals(other.getRole())) return false; 436 if (!getMembersList().equals(other.getMembersList())) return false; 437 if (hasCondition() != other.hasCondition()) return false; 438 if (hasCondition()) { 439 if (!getCondition().equals(other.getCondition())) return false; 440 } 441 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 442 return true; 443 } 444 445 @java.lang.Override hashCode()446 public int hashCode() { 447 if (memoizedHashCode != 0) { 448 return memoizedHashCode; 449 } 450 int hash = 41; 451 hash = (19 * hash) + getDescriptor().hashCode(); 452 hash = (37 * hash) + ROLE_FIELD_NUMBER; 453 hash = (53 * hash) + getRole().hashCode(); 454 if (getMembersCount() > 0) { 455 hash = (37 * hash) + MEMBERS_FIELD_NUMBER; 456 hash = (53 * hash) + getMembersList().hashCode(); 457 } 458 if (hasCondition()) { 459 hash = (37 * hash) + CONDITION_FIELD_NUMBER; 460 hash = (53 * hash) + getCondition().hashCode(); 461 } 462 hash = (29 * hash) + getUnknownFields().hashCode(); 463 memoizedHashCode = hash; 464 return hash; 465 } 466 parseFrom(java.nio.ByteBuffer data)467 public static com.google.iam.v1.Binding parseFrom(java.nio.ByteBuffer data) 468 throws com.google.protobuf.InvalidProtocolBufferException { 469 return PARSER.parseFrom(data); 470 } 471 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)472 public static com.google.iam.v1.Binding parseFrom( 473 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 474 throws com.google.protobuf.InvalidProtocolBufferException { 475 return PARSER.parseFrom(data, extensionRegistry); 476 } 477 parseFrom(com.google.protobuf.ByteString data)478 public static com.google.iam.v1.Binding parseFrom(com.google.protobuf.ByteString data) 479 throws com.google.protobuf.InvalidProtocolBufferException { 480 return PARSER.parseFrom(data); 481 } 482 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)483 public static com.google.iam.v1.Binding parseFrom( 484 com.google.protobuf.ByteString data, 485 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 486 throws com.google.protobuf.InvalidProtocolBufferException { 487 return PARSER.parseFrom(data, extensionRegistry); 488 } 489 parseFrom(byte[] data)490 public static com.google.iam.v1.Binding parseFrom(byte[] data) 491 throws com.google.protobuf.InvalidProtocolBufferException { 492 return PARSER.parseFrom(data); 493 } 494 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)495 public static com.google.iam.v1.Binding parseFrom( 496 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 497 throws com.google.protobuf.InvalidProtocolBufferException { 498 return PARSER.parseFrom(data, extensionRegistry); 499 } 500 parseFrom(java.io.InputStream input)501 public static com.google.iam.v1.Binding parseFrom(java.io.InputStream input) 502 throws java.io.IOException { 503 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 504 } 505 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)506 public static com.google.iam.v1.Binding parseFrom( 507 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 508 throws java.io.IOException { 509 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 510 PARSER, input, extensionRegistry); 511 } 512 parseDelimitedFrom(java.io.InputStream input)513 public static com.google.iam.v1.Binding parseDelimitedFrom(java.io.InputStream input) 514 throws java.io.IOException { 515 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 516 } 517 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)518 public static com.google.iam.v1.Binding parseDelimitedFrom( 519 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 520 throws java.io.IOException { 521 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 522 PARSER, input, extensionRegistry); 523 } 524 parseFrom(com.google.protobuf.CodedInputStream input)525 public static com.google.iam.v1.Binding parseFrom(com.google.protobuf.CodedInputStream input) 526 throws java.io.IOException { 527 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 528 } 529 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)530 public static com.google.iam.v1.Binding parseFrom( 531 com.google.protobuf.CodedInputStream input, 532 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 533 throws java.io.IOException { 534 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 535 PARSER, input, extensionRegistry); 536 } 537 538 @java.lang.Override newBuilderForType()539 public Builder newBuilderForType() { 540 return newBuilder(); 541 } 542 newBuilder()543 public static Builder newBuilder() { 544 return DEFAULT_INSTANCE.toBuilder(); 545 } 546 newBuilder(com.google.iam.v1.Binding prototype)547 public static Builder newBuilder(com.google.iam.v1.Binding prototype) { 548 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 549 } 550 551 @java.lang.Override toBuilder()552 public Builder toBuilder() { 553 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 554 } 555 556 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)557 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 558 Builder builder = new Builder(parent); 559 return builder; 560 } 561 /** 562 * 563 * 564 * <pre> 565 * Associates `members`, or principals, with a `role`. 566 * </pre> 567 * 568 * Protobuf type {@code google.iam.v1.Binding} 569 */ 570 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 571 implements 572 // @@protoc_insertion_point(builder_implements:google.iam.v1.Binding) 573 com.google.iam.v1.BindingOrBuilder { getDescriptor()574 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 575 return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_Binding_descriptor; 576 } 577 578 @java.lang.Override 579 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()580 internalGetFieldAccessorTable() { 581 return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_Binding_fieldAccessorTable 582 .ensureFieldAccessorsInitialized( 583 com.google.iam.v1.Binding.class, com.google.iam.v1.Binding.Builder.class); 584 } 585 586 // Construct using com.google.iam.v1.Binding.newBuilder() Builder()587 private Builder() {} 588 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)589 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 590 super(parent); 591 } 592 593 @java.lang.Override clear()594 public Builder clear() { 595 super.clear(); 596 bitField0_ = 0; 597 role_ = ""; 598 members_ = com.google.protobuf.LazyStringArrayList.EMPTY; 599 bitField0_ = (bitField0_ & ~0x00000002); 600 condition_ = null; 601 if (conditionBuilder_ != null) { 602 conditionBuilder_.dispose(); 603 conditionBuilder_ = null; 604 } 605 return this; 606 } 607 608 @java.lang.Override getDescriptorForType()609 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 610 return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_Binding_descriptor; 611 } 612 613 @java.lang.Override getDefaultInstanceForType()614 public com.google.iam.v1.Binding getDefaultInstanceForType() { 615 return com.google.iam.v1.Binding.getDefaultInstance(); 616 } 617 618 @java.lang.Override build()619 public com.google.iam.v1.Binding build() { 620 com.google.iam.v1.Binding result = buildPartial(); 621 if (!result.isInitialized()) { 622 throw newUninitializedMessageException(result); 623 } 624 return result; 625 } 626 627 @java.lang.Override buildPartial()628 public com.google.iam.v1.Binding buildPartial() { 629 com.google.iam.v1.Binding result = new com.google.iam.v1.Binding(this); 630 buildPartialRepeatedFields(result); 631 if (bitField0_ != 0) { 632 buildPartial0(result); 633 } 634 onBuilt(); 635 return result; 636 } 637 buildPartialRepeatedFields(com.google.iam.v1.Binding result)638 private void buildPartialRepeatedFields(com.google.iam.v1.Binding result) { 639 if (((bitField0_ & 0x00000002) != 0)) { 640 members_ = members_.getUnmodifiableView(); 641 bitField0_ = (bitField0_ & ~0x00000002); 642 } 643 result.members_ = members_; 644 } 645 buildPartial0(com.google.iam.v1.Binding result)646 private void buildPartial0(com.google.iam.v1.Binding result) { 647 int from_bitField0_ = bitField0_; 648 if (((from_bitField0_ & 0x00000001) != 0)) { 649 result.role_ = role_; 650 } 651 if (((from_bitField0_ & 0x00000004) != 0)) { 652 result.condition_ = conditionBuilder_ == null ? condition_ : conditionBuilder_.build(); 653 } 654 } 655 656 @java.lang.Override clone()657 public Builder clone() { 658 return super.clone(); 659 } 660 661 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)662 public Builder setField( 663 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 664 return super.setField(field, value); 665 } 666 667 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)668 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 669 return super.clearField(field); 670 } 671 672 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)673 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 674 return super.clearOneof(oneof); 675 } 676 677 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)678 public Builder setRepeatedField( 679 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 680 return super.setRepeatedField(field, index, value); 681 } 682 683 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)684 public Builder addRepeatedField( 685 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 686 return super.addRepeatedField(field, value); 687 } 688 689 @java.lang.Override mergeFrom(com.google.protobuf.Message other)690 public Builder mergeFrom(com.google.protobuf.Message other) { 691 if (other instanceof com.google.iam.v1.Binding) { 692 return mergeFrom((com.google.iam.v1.Binding) other); 693 } else { 694 super.mergeFrom(other); 695 return this; 696 } 697 } 698 mergeFrom(com.google.iam.v1.Binding other)699 public Builder mergeFrom(com.google.iam.v1.Binding other) { 700 if (other == com.google.iam.v1.Binding.getDefaultInstance()) return this; 701 if (!other.getRole().isEmpty()) { 702 role_ = other.role_; 703 bitField0_ |= 0x00000001; 704 onChanged(); 705 } 706 if (!other.members_.isEmpty()) { 707 if (members_.isEmpty()) { 708 members_ = other.members_; 709 bitField0_ = (bitField0_ & ~0x00000002); 710 } else { 711 ensureMembersIsMutable(); 712 members_.addAll(other.members_); 713 } 714 onChanged(); 715 } 716 if (other.hasCondition()) { 717 mergeCondition(other.getCondition()); 718 } 719 this.mergeUnknownFields(other.getUnknownFields()); 720 onChanged(); 721 return this; 722 } 723 724 @java.lang.Override isInitialized()725 public final boolean isInitialized() { 726 return true; 727 } 728 729 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)730 public Builder mergeFrom( 731 com.google.protobuf.CodedInputStream input, 732 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 733 throws java.io.IOException { 734 if (extensionRegistry == null) { 735 throw new java.lang.NullPointerException(); 736 } 737 try { 738 boolean done = false; 739 while (!done) { 740 int tag = input.readTag(); 741 switch (tag) { 742 case 0: 743 done = true; 744 break; 745 case 10: 746 { 747 role_ = input.readStringRequireUtf8(); 748 bitField0_ |= 0x00000001; 749 break; 750 } // case 10 751 case 18: 752 { 753 java.lang.String s = input.readStringRequireUtf8(); 754 ensureMembersIsMutable(); 755 members_.add(s); 756 break; 757 } // case 18 758 case 26: 759 { 760 input.readMessage(getConditionFieldBuilder().getBuilder(), extensionRegistry); 761 bitField0_ |= 0x00000004; 762 break; 763 } // case 26 764 default: 765 { 766 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 767 done = true; // was an endgroup tag 768 } 769 break; 770 } // default: 771 } // switch (tag) 772 } // while (!done) 773 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 774 throw e.unwrapIOException(); 775 } finally { 776 onChanged(); 777 } // finally 778 return this; 779 } 780 781 private int bitField0_; 782 783 private java.lang.Object role_ = ""; 784 /** 785 * 786 * 787 * <pre> 788 * Role that is assigned to the list of `members`, or principals. 789 * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 790 * </pre> 791 * 792 * <code>string role = 1;</code> 793 * 794 * @return The role. 795 */ getRole()796 public java.lang.String getRole() { 797 java.lang.Object ref = role_; 798 if (!(ref instanceof java.lang.String)) { 799 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 800 java.lang.String s = bs.toStringUtf8(); 801 role_ = s; 802 return s; 803 } else { 804 return (java.lang.String) ref; 805 } 806 } 807 /** 808 * 809 * 810 * <pre> 811 * Role that is assigned to the list of `members`, or principals. 812 * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 813 * </pre> 814 * 815 * <code>string role = 1;</code> 816 * 817 * @return The bytes for role. 818 */ getRoleBytes()819 public com.google.protobuf.ByteString getRoleBytes() { 820 java.lang.Object ref = role_; 821 if (ref instanceof String) { 822 com.google.protobuf.ByteString b = 823 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 824 role_ = b; 825 return b; 826 } else { 827 return (com.google.protobuf.ByteString) ref; 828 } 829 } 830 /** 831 * 832 * 833 * <pre> 834 * Role that is assigned to the list of `members`, or principals. 835 * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 836 * </pre> 837 * 838 * <code>string role = 1;</code> 839 * 840 * @param value The role to set. 841 * @return This builder for chaining. 842 */ setRole(java.lang.String value)843 public Builder setRole(java.lang.String value) { 844 if (value == null) { 845 throw new NullPointerException(); 846 } 847 role_ = value; 848 bitField0_ |= 0x00000001; 849 onChanged(); 850 return this; 851 } 852 /** 853 * 854 * 855 * <pre> 856 * Role that is assigned to the list of `members`, or principals. 857 * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 858 * </pre> 859 * 860 * <code>string role = 1;</code> 861 * 862 * @return This builder for chaining. 863 */ clearRole()864 public Builder clearRole() { 865 role_ = getDefaultInstance().getRole(); 866 bitField0_ = (bitField0_ & ~0x00000001); 867 onChanged(); 868 return this; 869 } 870 /** 871 * 872 * 873 * <pre> 874 * Role that is assigned to the list of `members`, or principals. 875 * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 876 * </pre> 877 * 878 * <code>string role = 1;</code> 879 * 880 * @param value The bytes for role to set. 881 * @return This builder for chaining. 882 */ setRoleBytes(com.google.protobuf.ByteString value)883 public Builder setRoleBytes(com.google.protobuf.ByteString value) { 884 if (value == null) { 885 throw new NullPointerException(); 886 } 887 checkByteStringIsUtf8(value); 888 role_ = value; 889 bitField0_ |= 0x00000001; 890 onChanged(); 891 return this; 892 } 893 894 private com.google.protobuf.LazyStringList members_ = 895 com.google.protobuf.LazyStringArrayList.EMPTY; 896 ensureMembersIsMutable()897 private void ensureMembersIsMutable() { 898 if (!((bitField0_ & 0x00000002) != 0)) { 899 members_ = new com.google.protobuf.LazyStringArrayList(members_); 900 bitField0_ |= 0x00000002; 901 } 902 } 903 /** 904 * 905 * 906 * <pre> 907 * Specifies the principals requesting access for a Cloud Platform resource. 908 * `members` can have the following values: 909 * * `allUsers`: A special identifier that represents anyone who is 910 * on the internet; with or without a Google account. 911 * * `allAuthenticatedUsers`: A special identifier that represents anyone 912 * who is authenticated with a Google account or a service account. 913 * * `user:{emailid}`: An email address that represents a specific Google 914 * account. For example, `alice@example.com` . 915 * * `serviceAccount:{emailid}`: An email address that represents a service 916 * account. For example, `my-other-app@appspot.gserviceaccount.com`. 917 * * `group:{emailid}`: An email address that represents a Google group. 918 * For example, `admins@example.com`. 919 * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique 920 * identifier) representing a user that has been recently deleted. For 921 * example, `alice@example.com?uid=123456789012345678901`. If the user is 922 * recovered, this value reverts to `user:{emailid}` and the recovered user 923 * retains the role in the binding. 924 * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 925 * unique identifier) representing a service account that has been recently 926 * deleted. For example, 927 * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 928 * If the service account is undeleted, this value reverts to 929 * `serviceAccount:{emailid}` and the undeleted service account retains the 930 * role in the binding. 931 * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique 932 * identifier) representing a Google group that has been recently 933 * deleted. For example, `admins@example.com?uid=123456789012345678901`. If 934 * the group is recovered, this value reverts to `group:{emailid}` and the 935 * recovered group retains the role in the binding. 936 * * `domain:{domain}`: The G Suite domain (primary) that represents all the 937 * users of that domain. For example, `google.com` or `example.com`. 938 * </pre> 939 * 940 * <code>repeated string members = 2;</code> 941 * 942 * @return A list containing the members. 943 */ getMembersList()944 public com.google.protobuf.ProtocolStringList getMembersList() { 945 return members_.getUnmodifiableView(); 946 } 947 /** 948 * 949 * 950 * <pre> 951 * Specifies the principals requesting access for a Cloud Platform resource. 952 * `members` can have the following values: 953 * * `allUsers`: A special identifier that represents anyone who is 954 * on the internet; with or without a Google account. 955 * * `allAuthenticatedUsers`: A special identifier that represents anyone 956 * who is authenticated with a Google account or a service account. 957 * * `user:{emailid}`: An email address that represents a specific Google 958 * account. For example, `alice@example.com` . 959 * * `serviceAccount:{emailid}`: An email address that represents a service 960 * account. For example, `my-other-app@appspot.gserviceaccount.com`. 961 * * `group:{emailid}`: An email address that represents a Google group. 962 * For example, `admins@example.com`. 963 * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique 964 * identifier) representing a user that has been recently deleted. For 965 * example, `alice@example.com?uid=123456789012345678901`. If the user is 966 * recovered, this value reverts to `user:{emailid}` and the recovered user 967 * retains the role in the binding. 968 * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 969 * unique identifier) representing a service account that has been recently 970 * deleted. For example, 971 * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 972 * If the service account is undeleted, this value reverts to 973 * `serviceAccount:{emailid}` and the undeleted service account retains the 974 * role in the binding. 975 * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique 976 * identifier) representing a Google group that has been recently 977 * deleted. For example, `admins@example.com?uid=123456789012345678901`. If 978 * the group is recovered, this value reverts to `group:{emailid}` and the 979 * recovered group retains the role in the binding. 980 * * `domain:{domain}`: The G Suite domain (primary) that represents all the 981 * users of that domain. For example, `google.com` or `example.com`. 982 * </pre> 983 * 984 * <code>repeated string members = 2;</code> 985 * 986 * @return The count of members. 987 */ getMembersCount()988 public int getMembersCount() { 989 return members_.size(); 990 } 991 /** 992 * 993 * 994 * <pre> 995 * Specifies the principals requesting access for a Cloud Platform resource. 996 * `members` can have the following values: 997 * * `allUsers`: A special identifier that represents anyone who is 998 * on the internet; with or without a Google account. 999 * * `allAuthenticatedUsers`: A special identifier that represents anyone 1000 * who is authenticated with a Google account or a service account. 1001 * * `user:{emailid}`: An email address that represents a specific Google 1002 * account. For example, `alice@example.com` . 1003 * * `serviceAccount:{emailid}`: An email address that represents a service 1004 * account. For example, `my-other-app@appspot.gserviceaccount.com`. 1005 * * `group:{emailid}`: An email address that represents a Google group. 1006 * For example, `admins@example.com`. 1007 * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique 1008 * identifier) representing a user that has been recently deleted. For 1009 * example, `alice@example.com?uid=123456789012345678901`. If the user is 1010 * recovered, this value reverts to `user:{emailid}` and the recovered user 1011 * retains the role in the binding. 1012 * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 1013 * unique identifier) representing a service account that has been recently 1014 * deleted. For example, 1015 * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 1016 * If the service account is undeleted, this value reverts to 1017 * `serviceAccount:{emailid}` and the undeleted service account retains the 1018 * role in the binding. 1019 * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique 1020 * identifier) representing a Google group that has been recently 1021 * deleted. For example, `admins@example.com?uid=123456789012345678901`. If 1022 * the group is recovered, this value reverts to `group:{emailid}` and the 1023 * recovered group retains the role in the binding. 1024 * * `domain:{domain}`: The G Suite domain (primary) that represents all the 1025 * users of that domain. For example, `google.com` or `example.com`. 1026 * </pre> 1027 * 1028 * <code>repeated string members = 2;</code> 1029 * 1030 * @param index The index of the element to return. 1031 * @return The members at the given index. 1032 */ getMembers(int index)1033 public java.lang.String getMembers(int index) { 1034 return members_.get(index); 1035 } 1036 /** 1037 * 1038 * 1039 * <pre> 1040 * Specifies the principals requesting access for a Cloud Platform resource. 1041 * `members` can have the following values: 1042 * * `allUsers`: A special identifier that represents anyone who is 1043 * on the internet; with or without a Google account. 1044 * * `allAuthenticatedUsers`: A special identifier that represents anyone 1045 * who is authenticated with a Google account or a service account. 1046 * * `user:{emailid}`: An email address that represents a specific Google 1047 * account. For example, `alice@example.com` . 1048 * * `serviceAccount:{emailid}`: An email address that represents a service 1049 * account. For example, `my-other-app@appspot.gserviceaccount.com`. 1050 * * `group:{emailid}`: An email address that represents a Google group. 1051 * For example, `admins@example.com`. 1052 * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique 1053 * identifier) representing a user that has been recently deleted. For 1054 * example, `alice@example.com?uid=123456789012345678901`. If the user is 1055 * recovered, this value reverts to `user:{emailid}` and the recovered user 1056 * retains the role in the binding. 1057 * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 1058 * unique identifier) representing a service account that has been recently 1059 * deleted. For example, 1060 * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 1061 * If the service account is undeleted, this value reverts to 1062 * `serviceAccount:{emailid}` and the undeleted service account retains the 1063 * role in the binding. 1064 * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique 1065 * identifier) representing a Google group that has been recently 1066 * deleted. For example, `admins@example.com?uid=123456789012345678901`. If 1067 * the group is recovered, this value reverts to `group:{emailid}` and the 1068 * recovered group retains the role in the binding. 1069 * * `domain:{domain}`: The G Suite domain (primary) that represents all the 1070 * users of that domain. For example, `google.com` or `example.com`. 1071 * </pre> 1072 * 1073 * <code>repeated string members = 2;</code> 1074 * 1075 * @param index The index of the value to return. 1076 * @return The bytes of the members at the given index. 1077 */ getMembersBytes(int index)1078 public com.google.protobuf.ByteString getMembersBytes(int index) { 1079 return members_.getByteString(index); 1080 } 1081 /** 1082 * 1083 * 1084 * <pre> 1085 * Specifies the principals requesting access for a Cloud Platform resource. 1086 * `members` can have the following values: 1087 * * `allUsers`: A special identifier that represents anyone who is 1088 * on the internet; with or without a Google account. 1089 * * `allAuthenticatedUsers`: A special identifier that represents anyone 1090 * who is authenticated with a Google account or a service account. 1091 * * `user:{emailid}`: An email address that represents a specific Google 1092 * account. For example, `alice@example.com` . 1093 * * `serviceAccount:{emailid}`: An email address that represents a service 1094 * account. For example, `my-other-app@appspot.gserviceaccount.com`. 1095 * * `group:{emailid}`: An email address that represents a Google group. 1096 * For example, `admins@example.com`. 1097 * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique 1098 * identifier) representing a user that has been recently deleted. For 1099 * example, `alice@example.com?uid=123456789012345678901`. If the user is 1100 * recovered, this value reverts to `user:{emailid}` and the recovered user 1101 * retains the role in the binding. 1102 * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 1103 * unique identifier) representing a service account that has been recently 1104 * deleted. For example, 1105 * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 1106 * If the service account is undeleted, this value reverts to 1107 * `serviceAccount:{emailid}` and the undeleted service account retains the 1108 * role in the binding. 1109 * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique 1110 * identifier) representing a Google group that has been recently 1111 * deleted. For example, `admins@example.com?uid=123456789012345678901`. If 1112 * the group is recovered, this value reverts to `group:{emailid}` and the 1113 * recovered group retains the role in the binding. 1114 * * `domain:{domain}`: The G Suite domain (primary) that represents all the 1115 * users of that domain. For example, `google.com` or `example.com`. 1116 * </pre> 1117 * 1118 * <code>repeated string members = 2;</code> 1119 * 1120 * @param index The index to set the value at. 1121 * @param value The members to set. 1122 * @return This builder for chaining. 1123 */ setMembers(int index, java.lang.String value)1124 public Builder setMembers(int index, java.lang.String value) { 1125 if (value == null) { 1126 throw new NullPointerException(); 1127 } 1128 ensureMembersIsMutable(); 1129 members_.set(index, value); 1130 onChanged(); 1131 return this; 1132 } 1133 /** 1134 * 1135 * 1136 * <pre> 1137 * Specifies the principals requesting access for a Cloud Platform resource. 1138 * `members` can have the following values: 1139 * * `allUsers`: A special identifier that represents anyone who is 1140 * on the internet; with or without a Google account. 1141 * * `allAuthenticatedUsers`: A special identifier that represents anyone 1142 * who is authenticated with a Google account or a service account. 1143 * * `user:{emailid}`: An email address that represents a specific Google 1144 * account. For example, `alice@example.com` . 1145 * * `serviceAccount:{emailid}`: An email address that represents a service 1146 * account. For example, `my-other-app@appspot.gserviceaccount.com`. 1147 * * `group:{emailid}`: An email address that represents a Google group. 1148 * For example, `admins@example.com`. 1149 * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique 1150 * identifier) representing a user that has been recently deleted. For 1151 * example, `alice@example.com?uid=123456789012345678901`. If the user is 1152 * recovered, this value reverts to `user:{emailid}` and the recovered user 1153 * retains the role in the binding. 1154 * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 1155 * unique identifier) representing a service account that has been recently 1156 * deleted. For example, 1157 * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 1158 * If the service account is undeleted, this value reverts to 1159 * `serviceAccount:{emailid}` and the undeleted service account retains the 1160 * role in the binding. 1161 * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique 1162 * identifier) representing a Google group that has been recently 1163 * deleted. For example, `admins@example.com?uid=123456789012345678901`. If 1164 * the group is recovered, this value reverts to `group:{emailid}` and the 1165 * recovered group retains the role in the binding. 1166 * * `domain:{domain}`: The G Suite domain (primary) that represents all the 1167 * users of that domain. For example, `google.com` or `example.com`. 1168 * </pre> 1169 * 1170 * <code>repeated string members = 2;</code> 1171 * 1172 * @param value The members to add. 1173 * @return This builder for chaining. 1174 */ addMembers(java.lang.String value)1175 public Builder addMembers(java.lang.String value) { 1176 if (value == null) { 1177 throw new NullPointerException(); 1178 } 1179 ensureMembersIsMutable(); 1180 members_.add(value); 1181 onChanged(); 1182 return this; 1183 } 1184 /** 1185 * 1186 * 1187 * <pre> 1188 * Specifies the principals requesting access for a Cloud Platform resource. 1189 * `members` can have the following values: 1190 * * `allUsers`: A special identifier that represents anyone who is 1191 * on the internet; with or without a Google account. 1192 * * `allAuthenticatedUsers`: A special identifier that represents anyone 1193 * who is authenticated with a Google account or a service account. 1194 * * `user:{emailid}`: An email address that represents a specific Google 1195 * account. For example, `alice@example.com` . 1196 * * `serviceAccount:{emailid}`: An email address that represents a service 1197 * account. For example, `my-other-app@appspot.gserviceaccount.com`. 1198 * * `group:{emailid}`: An email address that represents a Google group. 1199 * For example, `admins@example.com`. 1200 * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique 1201 * identifier) representing a user that has been recently deleted. For 1202 * example, `alice@example.com?uid=123456789012345678901`. If the user is 1203 * recovered, this value reverts to `user:{emailid}` and the recovered user 1204 * retains the role in the binding. 1205 * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 1206 * unique identifier) representing a service account that has been recently 1207 * deleted. For example, 1208 * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 1209 * If the service account is undeleted, this value reverts to 1210 * `serviceAccount:{emailid}` and the undeleted service account retains the 1211 * role in the binding. 1212 * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique 1213 * identifier) representing a Google group that has been recently 1214 * deleted. For example, `admins@example.com?uid=123456789012345678901`. If 1215 * the group is recovered, this value reverts to `group:{emailid}` and the 1216 * recovered group retains the role in the binding. 1217 * * `domain:{domain}`: The G Suite domain (primary) that represents all the 1218 * users of that domain. For example, `google.com` or `example.com`. 1219 * </pre> 1220 * 1221 * <code>repeated string members = 2;</code> 1222 * 1223 * @param values The members to add. 1224 * @return This builder for chaining. 1225 */ addAllMembers(java.lang.Iterable<java.lang.String> values)1226 public Builder addAllMembers(java.lang.Iterable<java.lang.String> values) { 1227 ensureMembersIsMutable(); 1228 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, members_); 1229 onChanged(); 1230 return this; 1231 } 1232 /** 1233 * 1234 * 1235 * <pre> 1236 * Specifies the principals requesting access for a Cloud Platform resource. 1237 * `members` can have the following values: 1238 * * `allUsers`: A special identifier that represents anyone who is 1239 * on the internet; with or without a Google account. 1240 * * `allAuthenticatedUsers`: A special identifier that represents anyone 1241 * who is authenticated with a Google account or a service account. 1242 * * `user:{emailid}`: An email address that represents a specific Google 1243 * account. For example, `alice@example.com` . 1244 * * `serviceAccount:{emailid}`: An email address that represents a service 1245 * account. For example, `my-other-app@appspot.gserviceaccount.com`. 1246 * * `group:{emailid}`: An email address that represents a Google group. 1247 * For example, `admins@example.com`. 1248 * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique 1249 * identifier) representing a user that has been recently deleted. For 1250 * example, `alice@example.com?uid=123456789012345678901`. If the user is 1251 * recovered, this value reverts to `user:{emailid}` and the recovered user 1252 * retains the role in the binding. 1253 * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 1254 * unique identifier) representing a service account that has been recently 1255 * deleted. For example, 1256 * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 1257 * If the service account is undeleted, this value reverts to 1258 * `serviceAccount:{emailid}` and the undeleted service account retains the 1259 * role in the binding. 1260 * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique 1261 * identifier) representing a Google group that has been recently 1262 * deleted. For example, `admins@example.com?uid=123456789012345678901`. If 1263 * the group is recovered, this value reverts to `group:{emailid}` and the 1264 * recovered group retains the role in the binding. 1265 * * `domain:{domain}`: The G Suite domain (primary) that represents all the 1266 * users of that domain. For example, `google.com` or `example.com`. 1267 * </pre> 1268 * 1269 * <code>repeated string members = 2;</code> 1270 * 1271 * @return This builder for chaining. 1272 */ clearMembers()1273 public Builder clearMembers() { 1274 members_ = com.google.protobuf.LazyStringArrayList.EMPTY; 1275 bitField0_ = (bitField0_ & ~0x00000002); 1276 onChanged(); 1277 return this; 1278 } 1279 /** 1280 * 1281 * 1282 * <pre> 1283 * Specifies the principals requesting access for a Cloud Platform resource. 1284 * `members` can have the following values: 1285 * * `allUsers`: A special identifier that represents anyone who is 1286 * on the internet; with or without a Google account. 1287 * * `allAuthenticatedUsers`: A special identifier that represents anyone 1288 * who is authenticated with a Google account or a service account. 1289 * * `user:{emailid}`: An email address that represents a specific Google 1290 * account. For example, `alice@example.com` . 1291 * * `serviceAccount:{emailid}`: An email address that represents a service 1292 * account. For example, `my-other-app@appspot.gserviceaccount.com`. 1293 * * `group:{emailid}`: An email address that represents a Google group. 1294 * For example, `admins@example.com`. 1295 * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique 1296 * identifier) representing a user that has been recently deleted. For 1297 * example, `alice@example.com?uid=123456789012345678901`. If the user is 1298 * recovered, this value reverts to `user:{emailid}` and the recovered user 1299 * retains the role in the binding. 1300 * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 1301 * unique identifier) representing a service account that has been recently 1302 * deleted. For example, 1303 * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 1304 * If the service account is undeleted, this value reverts to 1305 * `serviceAccount:{emailid}` and the undeleted service account retains the 1306 * role in the binding. 1307 * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique 1308 * identifier) representing a Google group that has been recently 1309 * deleted. For example, `admins@example.com?uid=123456789012345678901`. If 1310 * the group is recovered, this value reverts to `group:{emailid}` and the 1311 * recovered group retains the role in the binding. 1312 * * `domain:{domain}`: The G Suite domain (primary) that represents all the 1313 * users of that domain. For example, `google.com` or `example.com`. 1314 * </pre> 1315 * 1316 * <code>repeated string members = 2;</code> 1317 * 1318 * @param value The bytes of the members to add. 1319 * @return This builder for chaining. 1320 */ addMembersBytes(com.google.protobuf.ByteString value)1321 public Builder addMembersBytes(com.google.protobuf.ByteString value) { 1322 if (value == null) { 1323 throw new NullPointerException(); 1324 } 1325 checkByteStringIsUtf8(value); 1326 ensureMembersIsMutable(); 1327 members_.add(value); 1328 onChanged(); 1329 return this; 1330 } 1331 1332 private com.google.type.Expr condition_; 1333 private com.google.protobuf.SingleFieldBuilderV3< 1334 com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> 1335 conditionBuilder_; 1336 /** 1337 * 1338 * 1339 * <pre> 1340 * The condition that is associated with this binding. 1341 * If the condition evaluates to `true`, then this binding applies to the 1342 * current request. 1343 * If the condition evaluates to `false`, then this binding does not apply to 1344 * the current request. However, a different role binding might grant the same 1345 * role to one or more of the principals in this binding. 1346 * To learn which resources support conditions in their IAM policies, see the 1347 * [IAM 1348 * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 1349 * </pre> 1350 * 1351 * <code>.google.type.Expr condition = 3;</code> 1352 * 1353 * @return Whether the condition field is set. 1354 */ hasCondition()1355 public boolean hasCondition() { 1356 return ((bitField0_ & 0x00000004) != 0); 1357 } 1358 /** 1359 * 1360 * 1361 * <pre> 1362 * The condition that is associated with this binding. 1363 * If the condition evaluates to `true`, then this binding applies to the 1364 * current request. 1365 * If the condition evaluates to `false`, then this binding does not apply to 1366 * the current request. However, a different role binding might grant the same 1367 * role to one or more of the principals in this binding. 1368 * To learn which resources support conditions in their IAM policies, see the 1369 * [IAM 1370 * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 1371 * </pre> 1372 * 1373 * <code>.google.type.Expr condition = 3;</code> 1374 * 1375 * @return The condition. 1376 */ getCondition()1377 public com.google.type.Expr getCondition() { 1378 if (conditionBuilder_ == null) { 1379 return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; 1380 } else { 1381 return conditionBuilder_.getMessage(); 1382 } 1383 } 1384 /** 1385 * 1386 * 1387 * <pre> 1388 * The condition that is associated with this binding. 1389 * If the condition evaluates to `true`, then this binding applies to the 1390 * current request. 1391 * If the condition evaluates to `false`, then this binding does not apply to 1392 * the current request. However, a different role binding might grant the same 1393 * role to one or more of the principals in this binding. 1394 * To learn which resources support conditions in their IAM policies, see the 1395 * [IAM 1396 * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 1397 * </pre> 1398 * 1399 * <code>.google.type.Expr condition = 3;</code> 1400 */ setCondition(com.google.type.Expr value)1401 public Builder setCondition(com.google.type.Expr value) { 1402 if (conditionBuilder_ == null) { 1403 if (value == null) { 1404 throw new NullPointerException(); 1405 } 1406 condition_ = value; 1407 } else { 1408 conditionBuilder_.setMessage(value); 1409 } 1410 bitField0_ |= 0x00000004; 1411 onChanged(); 1412 return this; 1413 } 1414 /** 1415 * 1416 * 1417 * <pre> 1418 * The condition that is associated with this binding. 1419 * If the condition evaluates to `true`, then this binding applies to the 1420 * current request. 1421 * If the condition evaluates to `false`, then this binding does not apply to 1422 * the current request. However, a different role binding might grant the same 1423 * role to one or more of the principals in this binding. 1424 * To learn which resources support conditions in their IAM policies, see the 1425 * [IAM 1426 * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 1427 * </pre> 1428 * 1429 * <code>.google.type.Expr condition = 3;</code> 1430 */ setCondition(com.google.type.Expr.Builder builderForValue)1431 public Builder setCondition(com.google.type.Expr.Builder builderForValue) { 1432 if (conditionBuilder_ == null) { 1433 condition_ = builderForValue.build(); 1434 } else { 1435 conditionBuilder_.setMessage(builderForValue.build()); 1436 } 1437 bitField0_ |= 0x00000004; 1438 onChanged(); 1439 return this; 1440 } 1441 /** 1442 * 1443 * 1444 * <pre> 1445 * The condition that is associated with this binding. 1446 * If the condition evaluates to `true`, then this binding applies to the 1447 * current request. 1448 * If the condition evaluates to `false`, then this binding does not apply to 1449 * the current request. However, a different role binding might grant the same 1450 * role to one or more of the principals in this binding. 1451 * To learn which resources support conditions in their IAM policies, see the 1452 * [IAM 1453 * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 1454 * </pre> 1455 * 1456 * <code>.google.type.Expr condition = 3;</code> 1457 */ mergeCondition(com.google.type.Expr value)1458 public Builder mergeCondition(com.google.type.Expr value) { 1459 if (conditionBuilder_ == null) { 1460 if (((bitField0_ & 0x00000004) != 0) 1461 && condition_ != null 1462 && condition_ != com.google.type.Expr.getDefaultInstance()) { 1463 getConditionBuilder().mergeFrom(value); 1464 } else { 1465 condition_ = value; 1466 } 1467 } else { 1468 conditionBuilder_.mergeFrom(value); 1469 } 1470 bitField0_ |= 0x00000004; 1471 onChanged(); 1472 return this; 1473 } 1474 /** 1475 * 1476 * 1477 * <pre> 1478 * The condition that is associated with this binding. 1479 * If the condition evaluates to `true`, then this binding applies to the 1480 * current request. 1481 * If the condition evaluates to `false`, then this binding does not apply to 1482 * the current request. However, a different role binding might grant the same 1483 * role to one or more of the principals in this binding. 1484 * To learn which resources support conditions in their IAM policies, see the 1485 * [IAM 1486 * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 1487 * </pre> 1488 * 1489 * <code>.google.type.Expr condition = 3;</code> 1490 */ clearCondition()1491 public Builder clearCondition() { 1492 bitField0_ = (bitField0_ & ~0x00000004); 1493 condition_ = null; 1494 if (conditionBuilder_ != null) { 1495 conditionBuilder_.dispose(); 1496 conditionBuilder_ = null; 1497 } 1498 onChanged(); 1499 return this; 1500 } 1501 /** 1502 * 1503 * 1504 * <pre> 1505 * The condition that is associated with this binding. 1506 * If the condition evaluates to `true`, then this binding applies to the 1507 * current request. 1508 * If the condition evaluates to `false`, then this binding does not apply to 1509 * the current request. However, a different role binding might grant the same 1510 * role to one or more of the principals in this binding. 1511 * To learn which resources support conditions in their IAM policies, see the 1512 * [IAM 1513 * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 1514 * </pre> 1515 * 1516 * <code>.google.type.Expr condition = 3;</code> 1517 */ getConditionBuilder()1518 public com.google.type.Expr.Builder getConditionBuilder() { 1519 bitField0_ |= 0x00000004; 1520 onChanged(); 1521 return getConditionFieldBuilder().getBuilder(); 1522 } 1523 /** 1524 * 1525 * 1526 * <pre> 1527 * The condition that is associated with this binding. 1528 * If the condition evaluates to `true`, then this binding applies to the 1529 * current request. 1530 * If the condition evaluates to `false`, then this binding does not apply to 1531 * the current request. However, a different role binding might grant the same 1532 * role to one or more of the principals in this binding. 1533 * To learn which resources support conditions in their IAM policies, see the 1534 * [IAM 1535 * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 1536 * </pre> 1537 * 1538 * <code>.google.type.Expr condition = 3;</code> 1539 */ getConditionOrBuilder()1540 public com.google.type.ExprOrBuilder getConditionOrBuilder() { 1541 if (conditionBuilder_ != null) { 1542 return conditionBuilder_.getMessageOrBuilder(); 1543 } else { 1544 return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; 1545 } 1546 } 1547 /** 1548 * 1549 * 1550 * <pre> 1551 * The condition that is associated with this binding. 1552 * If the condition evaluates to `true`, then this binding applies to the 1553 * current request. 1554 * If the condition evaluates to `false`, then this binding does not apply to 1555 * the current request. However, a different role binding might grant the same 1556 * role to one or more of the principals in this binding. 1557 * To learn which resources support conditions in their IAM policies, see the 1558 * [IAM 1559 * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). 1560 * </pre> 1561 * 1562 * <code>.google.type.Expr condition = 3;</code> 1563 */ 1564 private com.google.protobuf.SingleFieldBuilderV3< 1565 com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> getConditionFieldBuilder()1566 getConditionFieldBuilder() { 1567 if (conditionBuilder_ == null) { 1568 conditionBuilder_ = 1569 new com.google.protobuf.SingleFieldBuilderV3< 1570 com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder>( 1571 getCondition(), getParentForChildren(), isClean()); 1572 condition_ = null; 1573 } 1574 return conditionBuilder_; 1575 } 1576 1577 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1578 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 1579 return super.setUnknownFields(unknownFields); 1580 } 1581 1582 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1583 public final Builder mergeUnknownFields( 1584 final com.google.protobuf.UnknownFieldSet unknownFields) { 1585 return super.mergeUnknownFields(unknownFields); 1586 } 1587 1588 // @@protoc_insertion_point(builder_scope:google.iam.v1.Binding) 1589 } 1590 1591 // @@protoc_insertion_point(class_scope:google.iam.v1.Binding) 1592 private static final com.google.iam.v1.Binding DEFAULT_INSTANCE; 1593 1594 static { 1595 DEFAULT_INSTANCE = new com.google.iam.v1.Binding(); 1596 } 1597 getDefaultInstance()1598 public static com.google.iam.v1.Binding getDefaultInstance() { 1599 return DEFAULT_INSTANCE; 1600 } 1601 1602 private static final com.google.protobuf.Parser<Binding> PARSER = 1603 new com.google.protobuf.AbstractParser<Binding>() { 1604 @java.lang.Override 1605 public Binding parsePartialFrom( 1606 com.google.protobuf.CodedInputStream input, 1607 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1608 throws com.google.protobuf.InvalidProtocolBufferException { 1609 Builder builder = newBuilder(); 1610 try { 1611 builder.mergeFrom(input, extensionRegistry); 1612 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1613 throw e.setUnfinishedMessage(builder.buildPartial()); 1614 } catch (com.google.protobuf.UninitializedMessageException e) { 1615 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 1616 } catch (java.io.IOException e) { 1617 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1618 .setUnfinishedMessage(builder.buildPartial()); 1619 } 1620 return builder.buildPartial(); 1621 } 1622 }; 1623 parser()1624 public static com.google.protobuf.Parser<Binding> parser() { 1625 return PARSER; 1626 } 1627 1628 @java.lang.Override getParserForType()1629 public com.google.protobuf.Parser<Binding> getParserForType() { 1630 return PARSER; 1631 } 1632 1633 @java.lang.Override getDefaultInstanceForType()1634 public com.google.iam.v1.Binding getDefaultInstanceForType() { 1635 return DEFAULT_INSTANCE; 1636 } 1637 } 1638